fixes for parsing directory of markdown files

pull/570/head
Richard Anthony Hein 10 months ago
parent e324b5ff30
commit 3bae493d3d

@ -140,7 +140,7 @@ class VectorStorage:
) )
# Reload vectorstore based on collection # Reload vectorstore based on collection
vectorstore = self.getVectorStore(collection_name=collection.name) vectorstore = self.getVectorStore(collection_name=self.directory)
# Create a new parent document retriever # Create a new parent document retriever
retriever = AsyncParentDocumentRetriever( retriever = AsyncParentDocumentRetriever(
@ -148,7 +148,11 @@ class VectorStorage:
vectorstore=vectorstore, vectorstore=vectorstore,
child_splitter=self.child_splitter, child_splitter=self.child_splitter,
parent_splitter=self.parent_splitter, parent_splitter=self.parent_splitter,
) )
# force reload of collection to make sure we don't have the default langchain collection
collection = self.client.get_collection(name=self.directory)
vectorstore = self.getVectorStore(collection_name=self.directory)
# Add documents to the collection and docstore # Add documents to the collection and docstore
print(f"Adding {len(documents)} documents to collection...") print(f"Adding {len(documents)} documents to collection...")
@ -179,7 +183,7 @@ class VectorStorage:
# Reload vectorstore based on collection to pass to parent doc retriever # Reload vectorstore based on collection to pass to parent doc retriever
collection = self.client.get_collection(name=self.directory) collection = self.client.get_collection(name=self.directory)
vectorstore = self.getVectorStore(collection_name=collection.name) vectorstore = self.getVectorStore(collection_name=self.directory)
retriever = AsyncParentDocumentRetriever( retriever = AsyncParentDocumentRetriever(
docstore=self.store, docstore=self.store,
vectorstore=vectorstore, vectorstore=vectorstore,

Loading…
Cancel
Save