AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.
list_agents should return string not JSON
Gershon Bialer2644bc86db12
diff --git a/autogpt/commands.py b/autogpt/commands.pyindex 7301ff68b2..122b453e0e 100644--- a/autogpt/commands.py+++ b/autogpt/commands.py@@ -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):diff --git a/tests/unit/test_commands.py b/tests/unit/test_commands.pyindex b7bddcec11..1ecfc517bc 100644--- a/tests/unit/test_commands.py+++ b/tests/unit/test_commands.py@@ -10,4 +10,7 @@ class TestCommands(unittest.TestCase):mock.return_value = objcommands.start_agent("Test Agent", "chat", "Hello, how are you?", "gpt2")agents = commands.list_agents()- self.assertEqual(agents[0], (0,'chat'))\ No newline at end of file+ 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)