diff --git a/backend/main.py b/backend/main.py index 8fabb39..fea6c86 100644 --- a/backend/main.py +++ b/backend/main.py @@ -96,8 +96,9 @@ async def stream_code(websocket: WebSocket): async def process_chunk(content): await websocket.send_json({"type": "chunk", "value": content}) - if params.get("resultImg") and params["resultImg"]: - prompt_messages = assemble_prompt(params["image"], params["resultImg"]) + if params.get("resultImage") and params["resultImage"]: + prompt_messages = assemble_prompt(params["image"], params["resultImage"]) + else: prompt_messages = assemble_prompt(params["image"]) diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 01ca77a..4c843d6 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -49,7 +49,8 @@ function App() { }, "setting" ); - const [isImgCompare, setIsImgCompare] = useState(false); + const [shouldIncludeResultImage, setShouldIncludeResultImage] = + useState(false); const wsRef = useRef(null); const takeScreenshot = async (): Promise => { @@ -127,7 +128,7 @@ function App() { // Subsequent updates async function doUpdate() { const updatedHistory = [...history, generatedCode, updateInstruction]; - if (isImgCompare) { + if (shouldIncludeResultImage) { const resultImage = await takeScreenshot(); doGenerateCode({ generationType: "update", @@ -206,18 +207,20 @@ function App() { {appState === AppState.CODE_READY && (
-
-
Auto Image Comparison
- -