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