[Bug Fix] Fix issue with chromadb not working with 0.6.0 and onwards (#2279)

This commit is contained in:
Deshraj Yadav
2025-02-28 23:39:59 -08:00
committed by GitHub
parent 4318663697
commit 32ebdaef2f

View File

@@ -105,10 +105,10 @@ class ChromaDB(VectorStoreBase):
chromadb.Collection: The created or retrieved collection.
"""
# Skip creating collection if already exists
collections = self.list_cols()
for collection in collections:
if collection.name == name:
logging.debug(f"Collection {name} already exists. Skipping creation.")
collection_info = self.client.get_collection(name=name)
if collection_info:
logging.debug(f"Collection {name} already exists. Skipping creation.")
return collection_info
collection = self.client.get_or_create_collection(
name=name,