mirror of
https://github.com/aljazceru/Auto-GPT.git
synced 2025-12-19 06:54:22 +01:00
Vector memory revamp (part 1: refactoring) (#4208)
Additional changes: * Improve typing * Modularize message history memory & fix/refactor lots of things * Fix summarization * Move memory relevance calculation to MemoryItem & improve test * Fix import warnings in web_selenium.py * Remove `memory_add` ghost command * Implement overlap in `split_text` * Move memory tests into subdirectory * Remove deprecated `get_ada_embedding()` and helpers * Fix used token calculation in `chat_with_ai` * Replace Message TypedDict by dataclass * Fix AgentManager singleton issues in tests --------- Co-authored-by: Auto-GPT-Bot <github-bot@agpt.co>
This commit is contained in:
committed by
GitHub
parent
10489e0df2
commit
bfbe613960
@@ -3,7 +3,7 @@ import logging
|
||||
|
||||
from autogpt.commands.file_operations import ingest_file, list_files
|
||||
from autogpt.config import Config
|
||||
from autogpt.memory import get_memory
|
||||
from autogpt.memory.vector import VectorMemory, get_memory
|
||||
|
||||
cfg = Config()
|
||||
|
||||
@@ -21,14 +21,14 @@ def configure_logging():
|
||||
return logging.getLogger("AutoGPT-Ingestion")
|
||||
|
||||
|
||||
def ingest_directory(directory, memory, args):
|
||||
def ingest_directory(directory: str, memory: VectorMemory, args):
|
||||
"""
|
||||
Ingest all files in a directory by calling the ingest_file function for each file.
|
||||
|
||||
:param directory: The directory containing the files to ingest
|
||||
:param memory: An object with an add() method to store the chunks in memory
|
||||
"""
|
||||
global logger
|
||||
logger = logging.getLogger("AutoGPT-Ingestion")
|
||||
try:
|
||||
files = list_files(directory)
|
||||
for file in files:
|
||||
|
||||
Reference in New Issue
Block a user