mirror of
https://github.com/aljazceru/Auto-GPT.git
synced 2025-12-24 01:14:22 +01:00
Remove another global memory access
This commit is contained in:
@@ -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.")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user