From 0533da72d72303dc94c00b314b0194e027d0371c Mon Sep 17 00:00:00 2001 From: Deven Patel Date: Tue, 7 Nov 2023 02:46:39 -0800 Subject: [PATCH] [Improvement] add delete functionality to zilliz DB (#912) Co-authored-by: Deven Patel --- docs/components/vector-databases.mdx | 2 +- embedchain/vectordb/zilliz.py | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/docs/components/vector-databases.mdx b/docs/components/vector-databases.mdx index ccb5dc66..db198316 100644 --- a/docs/components/vector-databases.mdx +++ b/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 diff --git a/embedchain/vectordb/zilliz.py b/embedchain/vectordb/zilliz.py index f0f25eb1..7779f344 100644 --- a/embedchain/vectordb/zilliz.py +++ b/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, + )