Skip to content

Commit

Permalink
Merge pull request #1507 from jacobtohahn/fix_agent_key_error
Browse files Browse the repository at this point in the history
Fix agent key error
  • Loading branch information
richbeales authored Apr 15, 2023
2 parents b171774 + 26b3126 commit f6a8da0
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions autogpt/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,11 +263,8 @@ def message_agent(key: str, message: str) -> str:
# Check if the key is a valid integer
if is_valid_int(key):
agent_response = AGENT_MANAGER.message_agent(int(key), message)
# Check if the key is a valid string
elif isinstance(key, str):
agent_response = AGENT_MANAGER.message_agent(key, message)
else:
return "Invalid key, must be an integer or a string."
return "Invalid key, must be an integer."

# Speak response
if CFG.speak_mode:
Expand Down

0 comments on commit f6a8da0

Please sign in to comment.