Skip to content

Commit

Permalink
fix complexity
Browse files Browse the repository at this point in the history
  • Loading branch information
dillonalaird committed Sep 22, 2024
1 parent 9b26db3 commit 921d3b7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions vision_agent/agent/vision_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,8 @@ def chat_with_code(
orig_chat.append({"role": "observation", "content": artifacts_loaded})
self.streaming_message({"role": "observation", "content": artifacts_loaded})

if isinstance(last_user_message_content, str):
if int_chat[-1]["role"] == "user":
last_user_message_content = cast(str, int_chat[-1].get("content", ""))
user_code_action = parse_execution(last_user_message_content, False)
if user_code_action is not None:
user_result, user_obs = run_code_action(
Expand Down Expand Up @@ -320,8 +321,7 @@ def chat_with_code(
else:
self.streaming_message({"role": "assistant", "content": response})

if response["let_user_respond"]:
break
finished = response["let_user_respond"]

code_action = parse_execution(
response["response"], test_multi_plan, customized_tool_names
Expand Down

0 comments on commit 921d3b7

Please sign in to comment.