diff --git a/src/chroma_client.py b/src/chroma_client.py index f25fff5..78b8af8 100644 --- a/src/chroma_client.py +++ b/src/chroma_client.py @@ -13,6 +13,14 @@ def __init__(self, api_key, path="tmp/chroma"): self.api_key = api_key self.client.heartbeat() + def get_collection(self, name): + """Get a Chroma collection.""" + try: + collection = self.client.get_collection(name=name) + return collection + except AttributeError: + return st.error("An error ocurred while getting the collection.") + def create_collection(self, name): """Create a Chroma collection.""" try: