fix: Adjust message handling in process method; ensure correct image assignment and add next steps output

This commit is contained in:
Showdown76 2025-05-19 13:13:28 +02:00
parent b881f04acc
commit 2bcddedca5

View File

@ -67,12 +67,19 @@ class AIProcessor:
)
outputs.append(r) if r else None
# Make sure the two last messages from user has an image, but set disable_image to True for the others
for msg in self.session.messages[-2:]:
for msg in self.session.messages[:-2]:
msg.image = None
logger.debug(
self.session.messages
)
if reexec:
self.session.messages.append(
aic.Message(
role="user",
content="Tool Output: Next Steps: " + nextsteps,
)
)
img = ai.compute.screenshot_to_base64(
ai.compute.take_screenshot()
)