From 5bfccd800e20b2c774e1eca03ec13116abe7af27 Mon Sep 17 00:00:00 2001 From: Reinier van der Leer Date: Thu, 31 Aug 2023 01:49:57 +0200 Subject: [PATCH] Disable memory creation --- autogpt/commands/file_operations.py | 8 ++++---- autogpt/commands/web_selenium.py | 12 +++++++----- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/autogpt/commands/file_operations.py b/autogpt/commands/file_operations.py index 83d60705..1750dbde 100644 --- a/autogpt/commands/file_operations.py +++ b/autogpt/commands/file_operations.py @@ -155,10 +155,10 @@ def read_file(filename: Path, agent: Agent) -> str: """ content = read_textual_file(filename, logger) - # TODO: invalidate/update memory when file is edited - file_memory = MemoryItem.from_text_file(content, str(filename), agent.config) - if len(file_memory.chunks) > 1: - return file_memory.summary + # # TODO: invalidate/update memory when file is edited + # file_memory = MemoryItem.from_text_file(content, str(filename), agent.config) + # if len(file_memory.chunks) > 1: + # return file_memory.summary return content diff --git a/autogpt/commands/web_selenium.py b/autogpt/commands/web_selenium.py index 212b1bb4..c47ab360 100644 --- a/autogpt/commands/web_selenium.py +++ b/autogpt/commands/web_selenium.py @@ -40,8 +40,8 @@ if TYPE_CHECKING: from autogpt.agents.utils.exceptions import CommandExecutionError from autogpt.command_decorator import command from autogpt.llm.utils import count_string_tokens -from autogpt.memory.vector import MemoryItem, get_memory from autogpt.processing.html import extract_hyperlinks, format_hyperlinks +from autogpt.processing.text import summarize_text from autogpt.url_utils.validators import validate_url logger = logging.getLogger(__name__) @@ -271,8 +271,10 @@ def summarize_memorize_webpage( text_length = len(text) logger.info(f"Text length: {text_length} characters") - memory = get_memory(agent.config) + # memory = get_memory(agent.config) - new_memory = MemoryItem.from_webpage(text, url, agent.config, question=question) - memory.add(new_memory) - return new_memory.summary + # new_memory = MemoryItem.from_webpage(text, url, agent.config, question=question) + # memory.add(new_memory) + + summary, _ = summarize_text(text, question=question, config=agent.config) + return summary