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.
Move misplaced log_cycle statements
Reinier van der Leerddb7efa593db
diff --git a/autogpt/agents/agent.py b/autogpt/agents/agent.pyindex 93d3de8657..563c682385 100644--- a/autogpt/agents/agent.py+++ b/autogpt/agents/agent.py@@ -17,6 +17,7 @@ from autogpt.llm.base import Messagefrom autogpt.llm.utils import count_string_tokensfrom autogpt.logs import loggerfrom autogpt.logs.log_cycle import (+ CURRENT_CONTEXT_FILE_NAME,FULL_MESSAGE_HISTORY_FILE_NAME,NEXT_ACTION_FILE_NAME,USER_INPUT_FILE_NAME,@@ -109,6 +110,13 @@ class Agent(BaseAgent):self.history.raw(),FULL_MESSAGE_HISTORY_FILE_NAME,)+ self.log_cycle_handler.log_cycle(+ self.ai_config.ai_name,+ self.created_at,+ self.cycle_count,+ prompt.raw(),+ CURRENT_CONTEXT_FILE_NAME,+ )return promptdef execute(diff --git a/autogpt/agents/base.py b/autogpt/agents/base.pyindex 029b07a05a..e6b24be12b 100644--- a/autogpt/agents/base.py+++ b/autogpt/agents/base.py@@ -11,7 +11,7 @@ if TYPE_CHECKING:from autogpt.llm.base import ChatModelResponse, ChatSequence, Messagefrom autogpt.llm.providers.openai import OPEN_AI_CHAT_MODELS, get_openai_command_specsfrom autogpt.llm.utils import count_message_tokens, create_chat_completion-from autogpt.logs import CURRENT_CONTEXT_FILE_NAME, logger+from autogpt.logs import loggerfrom autogpt.memory.message_history import MessageHistoryfrom autogpt.prompts.prompt import DEFAULT_TRIGGERING_PROMPT@@ -105,13 +105,6 @@ class BaseAgent(metaclass=ABCMeta):prompt: ChatSequence = self.construct_prompt(instruction)prompt = self.on_before_think(prompt, instruction)- self.log_cycle_handler.log_cycle(- self.ai_config.ai_name,- self.created_at,- self.cycle_count,- prompt.raw(),- CURRENT_CONTEXT_FILE_NAME,- )raw_response = create_chat_completion(prompt,self.config,