mirror of
https://github.com/microsoft/graphrag.git
synced 2026-01-14 00:57:23 +08:00
Fix lancedb insertion
This commit is contained in:
parent
f4a20cd73d
commit
7ccf8d43a8
@ -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(
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user