Fix lancedb insertion

This commit is contained in:
Nathan Evans 2026-01-12 15:27:02 -08:00
parent f4a20cd73d
commit 7ccf8d43a8
2 changed files with 2 additions and 10 deletions

View File

@ -156,14 +156,10 @@ class CosmosDBVectorStore(BaseVectorStore):
# Upload documents to CosmosDB
for doc in documents:
if doc.vector is not None:
print("Document to store:") # noqa: T201
print(doc) # noqa: T201
doc_json = {
self.id_field: doc.id,
self.vector_field: doc.vector,
}
print("Storing document in CosmosDB:") # noqa: T201
print(doc_json) # noqa: T201
self._container_client.upsert_item(doc_json)
def similarity_search_by_vector(

View File

@ -84,12 +84,8 @@ class LanceDBVectorStore(BaseVectorStore):
})
if data:
self.document_collection = self.db_connection.create_table(
self.index_name if self.index_name else "",
data=data,
mode="overwrite",
schema=data.schema,
)
self.document_collection.add(data)
def similarity_search_by_vector(
self, query_embedding: list[float] | np.ndarray, k: int = 10