Skip to content

Commit 3d8243e

Browse files
authored
Catch all exceptions in autogpt (langchain-ai#3413)
Ought to be more autonomous
1 parent 738ee56 commit 3d8243e

File tree

1 file changed

+7
-1
lines changed
  • langchain/experimental/autonomous_agents/autogpt

1 file changed

+7
-1
lines changed

langchain/experimental/autonomous_agents/autogpt/agent.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,13 @@ def run(self, goals: List[str]) -> str:
110110
try:
111111
observation = tool.run(action.args)
112112
except ValidationError as e:
113-
observation = f"Error in args: {str(e)}"
113+
observation = (
114+
f"Validation Error in args: {str(e)}, args: {action.args}"
115+
)
116+
except Exception as e:
117+
observation = (
118+
f"Error: {str(e)}, {type(e).__name__}, args: {action.args}"
119+
)
114120
result = f"Command {tool.name} returned: {observation}"
115121
elif action.name == "ERROR":
116122
result = f"Error: {action.args}. "

0 commit comments

Comments
 (0)