Skip to content

Commit

Permalink
remove extra code
Browse files Browse the repository at this point in the history
  • Loading branch information
wuyiqunLu committed Sep 24, 2024
1 parent a85a38b commit 75aba6f
Showing 1 changed file with 5 additions and 14 deletions.
19 changes: 5 additions & 14 deletions vision_agent/agent/vision_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,6 @@
if str(WORKSPACE) != "":
os.environ["PYTHONPATH"] = f"{WORKSPACE}:{os.getenv('PYTHONPATH', '')}"

STUCK_IN_LOOP_ERROR_MESSAGE = {
"name": "Error when running conversation agent",
"value": "Agent is stuck in conversation loop, exited",
"traceback_raw": [],
}


class BoilerplateCode:
pre_code = [
Expand Down Expand Up @@ -298,13 +292,6 @@ def chat_with_code(
# sometimes it gets stuck in a loop, so we force it to exit
if last_response == response:
response["let_user_respond"] = True
self.streaming_message(
{
"role": "assistant",
"content": "{}",
"error": STUCK_IN_LOOP_ERROR_MESSAGE,
}
)

finished = response["let_user_respond"]

Expand All @@ -317,7 +304,11 @@ def chat_with_code(
{
"role": "assistant",
"content": "{}",
"error": STUCK_IN_LOOP_ERROR_MESSAGE,
"error": {
"name": "Error when running conversation agent",
"value": "Agent is stuck in conversation loop, exited",
"traceback_raw": [],
},
"finished": finished and code_action is None,
}
)
Expand Down

0 comments on commit 75aba6f

Please sign in to comment.