mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-02 18:33:33 -05:00
refac: vector db clients
This commit is contained in:
@@ -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