浏览代码

[Improvement] add delete functionality to zilliz DB (#912)

Co-authored-by: Deven Patel <deven298@yahoo.com>
Deven Patel 1 年之前
父节点
当前提交
0533da72d7
共有 2 个文件被更改,包括 14 次插入1 次删除
  1. 1 1
      docs/components/vector-databases.mdx
  2. 13 0
      embedchain/vectordb/zilliz.py

+ 1 - 1
docs/components/vector-databases.mdx

@@ -138,7 +138,7 @@ app = App.from_config(yaml_path="config.yaml")
 vectordb:
   provider: zilliz
   config:
-    collection_name: 'zilliz-app'
+    collection_name: 'zilliz_app'
     uri: https://xxxx.api.gcp-region.zillizcloud.com
     token: xxx
     vector_dim: 1536

+ 13 - 0
embedchain/vectordb/zilliz.py

@@ -222,3 +222,16 @@ class ZillizVectorDB(BaseVectorDB):
         if not isinstance(name, str):
             raise TypeError("Collection name must be a string")
         self.config.collection_name = name
+
+    def delete(self, keys: Union[list, str, int]):
+        """
+        Delete the embeddings from DB. Zilliz only support deleting with keys.
+
+
+        :param keys: Primary keys of the table entries to delete.
+        :type keys: Union[list, str, int]
+        """
+        self.client.delete(
+            collection_name=self.config.collection_name,
+            pks=keys,
+        )