refac: vector db clients
This commit is contained in:
1 parent
4775fe43d8
commit
8be6e16513
3 files changed
+9
-11
No files matched your search
@@ -80,13 +80,11 @@ class MilvusClient:
|
||||
index_params=index_params,
|
||||
)
|
||||
|
||||
def list_collections(self) -> list[str]:
|
||||
# List all the collections in the database.
|
||||
return [
|
||||
collection[len(self.collection_prefix) :]
|
||||
for collection in self.client.list_collections()
|
||||
if collection.startswith(self.collection_prefix)
|
||||
]
|
||||
def has_collection(self, collection_name: str) -> bool:
|
||||
# Check if the collection exists based on the collection name.
|
||||
return self.client.has_collection(
|
||||
collection_name=f"{self.collection_prefix}_{collection_name}"
|
||||
)
|
||||
|
||||
def delete_collection(self, collection_name: str):
|
||||
# Delete the collection based on the collection name.
|
||||
|
||||
Reference in new issue
Block a user