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.

Added time and date to the system message for each context

Ryan Peach47c6117e1886
diff --git a/scripts/chat.py b/scripts/chat.py
index 8da074c6bf..0b110bbae9 100644
--- a/scripts/chat.py
+++ b/scripts/chat.py
@@ -26,7 +26,10 @@ def create_chat_message(role, content):
def generate_context(prompt, relevant_memory, full_message_history, model):
current_context = [
create_chat_message(
- "system", prompt), create_chat_message(
+ "system", prompt),
+ create_chat_message(
+ "system", f"The current time and date is {time.strftime('%c')}"),
+ create_chat_message(
"system", f"Permanent memory: {relevant_memory}")]
# Add messages from the full message history until we reach the token limit
@@ -95,7 +98,7 @@ def chat_with_ai(
# Count the currently used tokens
current_tokens_used += tokens_to_add
-
+
# Move to the next most recent message in the full message history
next_message_to_add_index -= 1