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.
Turns of debug print. Full context is no longer printed to console each time, now optional for debugging.
Torantulino048ca5dec7a3
diff --git a/AutonomousAI/main.py b/AutonomousAI/main.pyindex e3220ecc2f..4ddce1ba76 100644--- a/AutonomousAI/main.py+++ b/AutonomousAI/main.py@@ -25,7 +25,7 @@ def create_chat_message(role, content):"""return {"role": role, "content": content}-def chat_with_ai(prompt, user_input, full_message_history, permanent_memory, token_limit):+def chat_with_ai(prompt, user_input, full_message_history, permanent_memory, token_limit, debug = False):"""Interact with the OpenAI API, sending the prompt, user input, message history, and permanent memory.@@ -44,13 +44,14 @@ def chat_with_ai(prompt, user_input, full_message_history, permanent_memory, tokcurrent_context.extend([create_chat_message("user", user_input)])# Debug print the current context- print("---------------------------")- print("Current Context:")- for message in current_context:- # Skip printing the prompt- if message["role"] == "system" and message["content"] == prompt:- continue- print(f"{message['role'].capitalize()}: {message['content']}")+ if debug:+ print("------------ CONTEXT SENT TO AI ---------------")+ for message in current_context:+ # Skip printing the prompt+ if message["role"] == "system" and message["content"] == prompt:+ continue+ print(f"{message['role'].capitalize()}: {message['content']}")+ print("----------- END OF CONTEXT ----------------")response = openai.ChatCompletion.create(model="gpt-4",