mirror of
https://github.com/aljazceru/Auto-GPT.git
synced 2025-12-18 22:44:21 +01:00
list_agents should return string not JSON
This commit is contained in:
@@ -265,7 +265,7 @@ def message_agent(key, message):
|
||||
|
||||
def list_agents():
|
||||
"""List all agents"""
|
||||
return agents.list_agents()
|
||||
return "List of agents:\n" + "\n".join([str(x[0]) + ": " + x[1] for x in agents.list_agents()])
|
||||
|
||||
|
||||
def delete_agent(key):
|
||||
|
||||
@@ -10,4 +10,7 @@ class TestCommands(unittest.TestCase):
|
||||
mock.return_value = obj
|
||||
commands.start_agent("Test Agent", "chat", "Hello, how are you?", "gpt2")
|
||||
agents = commands.list_agents()
|
||||
self.assertEqual(agents[0], (0,'chat'))
|
||||
self.assertEqual("List of agents:\n0: chat", agents)
|
||||
commands.start_agent("Test Agent 2", "write", "Hello, how are you?", "gpt2")
|
||||
agents = commands.list_agents()
|
||||
self.assertEqual("List of agents:\n0: chat\n1: write", agents)
|
||||
|
||||
Reference in New Issue
Block a user