Add screenshot re-execution logic in AIProcessor; append outputs from tool calls

This commit is contained in:
Showdown76 2025-05-19 09:34:21 +02:00
parent e573ecb553
commit 1925a77d85

View File

@ -62,13 +62,21 @@ class AIProcessor:
processor=self,
)
outputs.append(r) if r else None
if reexec:
img = ai.compute.screenshot_to_base64(
ai.compute.take_screenshot()
)
outputs.append(
*self.process(nextsteps, img)
)
return [
{
"name": tc.function.name,
"arguments": json.loads(tc.function.arguments),
}
for tc in tool_calls
]
] + outputs # type: ignore
# otherwise return final assistant content
print(f"Response: {json.dumps(response.to_dict(), indent=4)}") # debug