refac: vector db clients

This commit is contained in:
Timothy J. Baek committed 2024-09-12 02:00:31 -04:00
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.