mirror of
https://github.com/aljazceru/Auto-GPT.git
synced 2026-01-09 09:14:19 +01:00
Disable memory creation
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user