diff --git a/vision_agent/agent/vision_agent.py b/vision_agent/agent/vision_agent.py index 72727f49..962815aa 100644 --- a/vision_agent/agent/vision_agent.py +++ b/vision_agent/agent/vision_agent.py @@ -267,7 +267,11 @@ def chat_with_code( orig_chat.append({"role": "observation", "content": artifacts_loaded}) self.streaming_message({"role": "observation", "content": artifacts_loaded}) - user_code_action = parse_execution(last_user_message.get("content"), False) + user_code_action = None + if isinstance(last_user_message.get("content"), str): + user_code_action = parse_execution( + last_user_message.get("content"), False + ) if user_code_action is not None: user_result, user_obs = run_code_action(