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.
Fixes bug in message_agent: The model 'model' does not exist.
Torantulino7790066b3e97
diff --git a/AutonomousAI/agent_manager.py b/AutonomousAI/agent_manager.pyindex a1d789e0c9..25b5b82336 100644--- a/AutonomousAI/agent_manager.py+++ b/AutonomousAI/agent_manager.py@@ -1,7 +1,7 @@import openainext_key = 0-agents = {} # key, (task, full_message_history)+agents = {} # key, (task, full_message_history, model)# Create new GPT agentdef create_agent(task, prompt, model):@@ -24,21 +24,21 @@ def create_agent(task, prompt, model):key = next_keynext_key += 1 # This is done instead of len(agents) to make keys unique even if agents are deleted- agents[key] = (task, messages)+ agents[key] = (task, messages, model)return key, agent_replydef message_agent(key, message):global agents- task, messages = agents[key]+ task, messages, model = agents[key]# Add user message to message history before sending to agentmessages.append({"role": "user", "content": message})# Start GTP3 instanceresponse = openai.ChatCompletion.create(- model="model",+ model=model,messages=messages,)@@ -54,7 +54,7 @@ def list_agents():global agents# Return a list of agent keys and their tasks- return [(key, task) for key, (task, _) in agents.items()]+ return [(key, task) for key, (task, _, _) in agents.items()]def delete_agent(key):global agents