aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Reinier van der Leer <pwuts@agpt.co> 2023-12-13 22:50:02 +0100
committerGravatar Reinier van der Leer <pwuts@agpt.co> 2023-12-13 22:50:02 +0100
commit0e94c7b5fcd8e6a5010e76b21ae5b8382ac14831 (patch)
tree04b04577fd28d7d98d10b83c3e973d4b8058cdbd
parentfix: Implement self-correction for invalid LLM responses (diff)
downloadAuto-GPT-0e94c7b5fcd8e6a5010e76b21ae5b8382ac14831.tar.gz
Auto-GPT-0e94c7b5fcd8e6a5010e76b21ae5b8382ac14831.tar.bz2
Auto-GPT-0e94c7b5fcd8e6a5010e76b21ae5b8382ac14831.zip
fix(agent/tty): Fix `finish` command in TTY mode
- Prevent the Agent from treating `AgentTerminated` like it would any other exception raised by a command. - The agent should raise AgentTerminated exception to exit the loop.
-rw-r--r--autogpts/autogpt/autogpt/agents/agent.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/autogpts/autogpt/autogpt/agents/agent.py b/autogpts/autogpt/autogpt/agents/agent.py
index 2b4dcd5ab..88e6a46ed 100644
--- a/autogpts/autogpt/autogpt/agents/agent.py
+++ b/autogpts/autogpt/autogpt/agents/agent.py
@@ -250,6 +250,8 @@ class Agent(
self.context.add(context_item)
result = ActionSuccessResult(outputs=return_value)
+ except AgentTerminated:
+ raise
except AgentException as e:
result = ActionErrorResult.from_exception(e)