From 122af2effeccb0233e830e95c82f070877c34746 Mon Sep 17 00:00:00 2001 From: Bagatur <22008038+baskaryan@users.noreply.github.com> Date: Wed, 18 Oct 2023 09:24:04 -0700 Subject: [PATCH] fix chroma from_texts bug (#11984) --- libs/langchain/langchain/vectorstores/chroma.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libs/langchain/langchain/vectorstores/chroma.py b/libs/langchain/langchain/vectorstores/chroma.py index 26b6a1da8c5..86bd274dba4 100644 --- a/libs/langchain/langchain/vectorstores/chroma.py +++ b/libs/langchain/langchain/vectorstores/chroma.py @@ -626,6 +626,8 @@ class Chroma(VectorStore): collection_metadata=collection_metadata, **kwargs, ) + if ids is None: + ids = [str(uuid.uuid1()) for _ in texts] if hasattr( chroma_collection._client, "max_batch_size" ): # for Chroma 0.4.10 and above