From 5d839c9cd8e436cae1e45a798c07df1c5b3b5816 Mon Sep 17 00:00:00 2001 From: Trayan Azarov Date: Mon, 15 Jul 2024 10:12:10 +0300 Subject: [PATCH 1/2] feat: Schema builder --- chromadbx/core/__init__.py | 0 chromadbx/schema/__init__.py | 0 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 chromadbx/core/__init__.py create mode 100644 chromadbx/schema/__init__.py diff --git a/chromadbx/core/__init__.py b/chromadbx/core/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/chromadbx/schema/__init__.py b/chromadbx/schema/__init__.py new file mode 100644 index 0000000..e69de29 From f160cd9be533c4d4fb5bb4e4c3c01a457c20751a Mon Sep 17 00:00:00 2001 From: Trayan Azarov Date: Mon, 15 Jul 2024 10:12:48 +0300 Subject: [PATCH 2/2] chore: WIP --- chromadbx/schema/__init__.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/chromadbx/schema/__init__.py b/chromadbx/schema/__init__.py index e69de29..a6d37a8 100644 --- a/chromadbx/schema/__init__.py +++ b/chromadbx/schema/__init__.py @@ -0,0 +1,15 @@ +import chromadb +def collection_schema_builder(client:chromadb.ClientAPI, collection_name): + """ + Builds a collection Schema which provides insights into the information stored in the collection. + Should allow for an easy self-query by LLMs. + + :param client: + :param collection_name: + :return: + """ + collection = client.get_collection(collection_name) + if collection is None: + raise ValueError(f"Collection {collection_name} not found") + + return collection \ No newline at end of file