Merge pull request #1507 from jacobtohahn/fix_agent_key_error

Fix agent key error
This commit is contained in:
Richard Beales
2023-04-15 18:41:50 +01:00
committed by GitHub

View File

@@ -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: