From dea5000a014ea69d352400638e2f26dd77eacb20 Mon Sep 17 00:00:00 2001 From: Taylor Beeston Date: Mon, 17 Apr 2023 12:40:46 -0700 Subject: [PATCH] :bug: Fix pre_instruction --- autogpt/agent/agent_manager.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/autogpt/agent/agent_manager.py b/autogpt/agent/agent_manager.py index d26481508..286b8ebd1 100644 --- a/autogpt/agent/agent_manager.py +++ b/autogpt/agent/agent_manager.py @@ -1,9 +1,12 @@ """Agent manager for managing GPT agents""" from __future__ import annotations +from typing import List from autogpt.config.config import Config, Singleton from autogpt.llm_utils import create_chat_completion +from plugin_template import Message + class AgentManager(metaclass=Singleton): """Agent manager for managing GPT agents""" @@ -27,7 +30,7 @@ class AgentManager(metaclass=Singleton): Returns: The key of the new agent """ - messages = [ + messages: List[Message] = [ {"role": "user", "content": prompt}, ] for plugin in self.cfg.plugins: @@ -36,7 +39,7 @@ class AgentManager(metaclass=Singleton): plugin_messages = plugin.pre_instruction(messages) if plugin_messages: for plugin_message in plugin_messages: - messages.append({"role": "system", "content": plugin_message}) + messages.append(plugin_message) # Start GPT instance agent_reply = create_chat_completion( @@ -92,7 +95,7 @@ class AgentManager(metaclass=Singleton): plugin_messages = plugin.pre_instruction(messages) if plugin_messages: for plugin_message in plugin_messages: - messages.append({"role": "system", "content": plugin_message}) + messages.append(plugin_message) # Start GPT instance agent_reply = create_chat_completion(