(fix:indexes) look for the right path

This commit is contained in:
ManishMadan2882
2025-04-22 17:34:25 +05:30
parent 64c42f0ddf
commit 5ad34e2216
4 changed files with 128 additions and 34 deletions

View File

@@ -42,17 +42,18 @@ def embed_and_store_documents(docs, folder_name, source_id, task_status):
# Initialize vector store
if settings.VECTOR_STORE == "faiss":
docs_init = [docs.pop(0)]
store = VectorCreator.create_vectorstore(
settings.VECTOR_STORE,
docs_init=docs_init,
source_id=folder_name,
source_id=str(source_id),
embeddings_key=os.getenv("EMBEDDINGS_KEY"),
)
else:
store = VectorCreator.create_vectorstore(
settings.VECTOR_STORE,
source_id=source_id,
source_id=str(source_id),
embeddings_key=os.getenv("EMBEDDINGS_KEY"),
)
store.delete_index()
@@ -82,5 +83,6 @@ def embed_and_store_documents(docs, folder_name, source_id, task_status):
# Save the vector store
if settings.VECTOR_STORE == "faiss":
# For FAISS, save to the temporary folder first
store.save_local(folder_name)
logging.info("Vector store saved successfully.")