Skip to content

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.

:bug: Fix pre_instruction

Taylor Beestondea5000a014e
diff --git a/autogpt/agent/agent_manager.py b/autogpt/agent/agent_manager.py
index d264815084..286b8ebd1f 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(