Remove another global memory access

pull/3066/head
James Collins 2023-04-23 16:59:49 -07:00
parent 882a9086a8
commit 91aa40e0df
1 changed files with 3 additions and 3 deletions

View File

@ -10,7 +10,6 @@ from autogpt.llm_utils import create_chat_completion
from autogpt.memory import get_memory
CFG = Config()
MEMORY = get_memory(CFG)
def split_text(
@ -109,7 +108,8 @@ def summarize_text(
memory_to_add = f"Source: {url}\n" f"Raw content part#{i + 1}: {chunk}"
MEMORY.add(memory_to_add)
memory = get_memory(CFG)
memory.add(memory_to_add)
messages = [create_message(chunk, question)]
tokens_for_chunk = token_counter.count_message_tokens(messages, model)
@ -128,7 +128,7 @@ def summarize_text(
memory_to_add = f"Source: {url}\n" f"Content summary part#{i + 1}: {summary}"
MEMORY.add(memory_to_add)
memory.add(memory_to_add)
print(f"Summarized {len(chunks)} chunks.")