From 5e5749622505aaed74563731de32fa3d0a37fe7e Mon Sep 17 00:00:00 2001 From: rkeshwani Date: Sat, 8 Apr 2023 15:31:17 -0500 Subject: [PATCH] =?UTF-8?q?#2595=20ChromaDB:=20Add=20ability=20to=20adjust?= =?UTF-8?q?=20metadata=20for=20indexes=20upon=20creating=20co=E2=80=A6=20(?= =?UTF-8?q?#2597)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Referencing #2595 Added optional default parameter to adjust index metadata upon collection creation per chroma code https://github.com/chroma-core/chroma/blob/ce0bc897776f9bcdd5df4397e6ce5e7bd695f986/chromadb/api/local.py#L74 Allowing for user to have the ability to adjust distance calculation functions. --- langchain/vectorstores/chroma.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/langchain/vectorstores/chroma.py b/langchain/vectorstores/chroma.py index e70b497d..903be694 100644 --- a/langchain/vectorstores/chroma.py +++ b/langchain/vectorstores/chroma.py @@ -59,6 +59,7 @@ class Chroma(VectorStore): embedding_function: Optional[Embeddings] = None, persist_directory: Optional[str] = None, client_settings: Optional[chromadb.config.Settings] = None, + collection_metadata: Optional[Dict] = None, ) -> None: """Initialize with Chroma client.""" try: @@ -86,6 +87,7 @@ class Chroma(VectorStore): embedding_function=self._embedding_function.embed_documents if self._embedding_function is not None else None, + metadata=collection_metadata, ) def add_texts(