Merge remote-tracking branch 'origin/master' into fix_agents

This commit is contained in:
Gershon Bialer
2023-04-15 10:04:15 -07:00
77 changed files with 2683 additions and 1992 deletions

View File

@@ -1,4 +1,5 @@
from autogpt import commands
import autogpt.agent.agent_manager as agent_manager
from autogpt.app import start_agent, list_agents
import unittest
from unittest.mock import patch, MagicMock
@@ -9,9 +10,9 @@ class TestCommands(unittest.TestCase):
obj = MagicMock()
obj.response.choices[0].messages[0].content = "Test message"
mock.return_value = obj
commands.start_agent("Test Agent", "chat", "Hello, how are you?", "gpt2")
agents = commands.list_agents()
start_agent("Test Agent", "chat", "Hello, how are you?", "gpt2")
agents = list_agents()
self.assertEqual("List of agents:\n0: chat", agents)
commands.start_agent("Test Agent 2", "write", "Hello, how are you?", "gpt2")
agents = commands.list_agents()
start_agent("Test Agent 2", "write", "Hello, how are you?", "gpt2")
agents = list_agents()
self.assertEqual("List of agents:\n0: chat\n1: write", agents)