Skip to content

armgit / letta

Public Imported from GitHub
0

Platform for stateful agents: AI with advanced memory that can learn and self-improve over time.

fix: bug with loading directories (#1073)

Sarah Wooders0712141af61b
diff --git a/memgpt/autogen/memgpt_agent.py b/memgpt/autogen/memgpt_agent.py
index 6adcb649d..50013c407 100644
--- a/memgpt/autogen/memgpt_agent.py
+++ b/memgpt/autogen/memgpt_agent.py
@@ -62,8 +62,6 @@ class MemGPTConversableAgent(ConversableAgent):
load_directory(name=name, **kwargs)
elif type == "webpage":
load_webpage(name=name, **kwargs)
- elif type == "index":
- load_index(name=name, **kwargs)
elif type == "database":
load_database(name=name, **kwargs)
elif type == "vector_database":
diff --git a/memgpt/data_sources/connectors.py b/memgpt/data_sources/connectors.py
index a01878889..c54a95b8a 100644
--- a/memgpt/data_sources/connectors.py
+++ b/memgpt/data_sources/connectors.py
@@ -86,7 +86,7 @@ class DirectoryConnector(DataConnector):
self.extensions = extensions
if self.recursive == True:
- assert self.input_dir is not None, "Must provide input directory if recursive is True."
+ assert self.input_directory is not None, "Must provide input directory if recursive is True."
def generate_documents(self) -> Iterator[Tuple[str, Dict]]: # -> Iterator[Document]:
from llama_index.core import SimpleDirectoryReader
@@ -101,7 +101,7 @@ class DirectoryConnector(DataConnector):
assert self.input_files is not None, "Must provide input files if input_dir is None"
reader = SimpleDirectoryReader(input_files=[str(f) for f in self.input_files])
- llama_index_docs = reader.load_data()
+ llama_index_docs = reader.load_data(show_progress=True)
docs = []
for llama_index_doc in llama_index_docs:
# TODO: add additional metadata?