Skip to content

Commit

Permalink
fix: vector cache generation
Browse files Browse the repository at this point in the history
  • Loading branch information
fynnfluegge committed Feb 16, 2025
1 parent 6629556 commit 21dfa84
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion codeqai/vector_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def index_documents(self, documents: list[Document]):
index_to_docstore_id = self.db.index_to_docstore_id
for i in range(len(documents)):
document = self.db.docstore.search(index_to_docstore_id[i])
if document and document is type(Document):
if document and isinstance(document, Document):
# Check if the document is already present in the vector cache
# if yes, then add the vector id to the vector cache entry
if self.vector_cache.get(document.metadata["filename"]):
Expand Down
2 changes: 1 addition & 1 deletion tests/vector_store_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import pytest
from langchain.schema import Document
from langchain_community.embeddings import FakeEmbeddings
from langchain_core.embeddings import FakeEmbeddings

from codeqai.cache import get_cache_path
from codeqai.vector_store import VectorStore
Expand Down

0 comments on commit 21dfa84

Please sign in to comment.