From 562ca45e07502aa1d8d66ceff1ca1c66594b720d Mon Sep 17 00:00:00 2001 From: Bowen Liang Date: Tue, 27 Feb 2024 11:14:35 +0800 Subject: [PATCH] fix weaviate delete_by_ids (#2565) --- api/core/rag/datasource/vdb/weaviate/weaviate_vector.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/api/core/rag/datasource/vdb/weaviate/weaviate_vector.py b/api/core/rag/datasource/vdb/weaviate/weaviate_vector.py index 78033379d6..008e54085d 100644 --- a/api/core/rag/datasource/vdb/weaviate/weaviate_vector.py +++ b/api/core/rag/datasource/vdb/weaviate/weaviate_vector.py @@ -150,10 +150,11 @@ class WeaviateVector(BaseVector): return True def delete_by_ids(self, ids: list[str]) -> None: - self._client.data_object.delete( - ids, - class_name=self._collection_name - ) + for uuid in ids: + self._client.data_object.delete( + class_name=self._collection_name, + uuid=uuid, + ) def search_by_vector(self, query_vector: list[float], **kwargs: Any) -> list[Document]: """Look up similar documents by embedding vector in Weaviate."""