From ff46c16805a53fed4309376bb5361710232a614d Mon Sep 17 00:00:00 2001 From: Kinance Date: Mon, 12 Jun 2023 09:13:47 +0900 Subject: [PATCH] Remove extra spaces in summarization prompt (#4660) * Implement Batch Running Summarization to avoid max token error (#4652) * Fix extra space in prompt --------- Co-authored-by: Reinier van der Leer --- autogpt/memory/message_history.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/autogpt/memory/message_history.py b/autogpt/memory/message_history.py index 2ae53055..7f307536 100644 --- a/autogpt/memory/message_history.py +++ b/autogpt/memory/message_history.py @@ -199,18 +199,18 @@ class MessageHistory: def summarize_batch(self, new_events_batch, cfg): prompt = f'''Your task is to create a concise running summary of actions and information results in the provided text, focusing on key and potentially important information to remember. - You will receive the current summary and your latest actions. Combine them, adding relevant key information from the latest development in 1st person past tense and keeping the summary concise. +You will receive the current summary and your latest actions. Combine them, adding relevant key information from the latest development in 1st person past tense and keeping the summary concise. - Summary So Far: - """ - {self.summary} - """ +Summary So Far: +""" +{self.summary} +""" - Latest Development: - """ - {new_events_batch or "Nothing new happened."} - """ - ''' +Latest Development: +""" +{new_events_batch or "Nothing new happened."} +""" +''' prompt = ChatSequence.for_model(cfg.fast_llm_model, [Message("user", prompt)]) self.agent.log_cycle_handler.log_cycle(