Skip to content

The agent engineering platform.

fix chroma from_texts bug (#11984)

Bagatur122af2effecc
diff --git a/libs/langchain/langchain/vectorstores/chroma.py b/libs/langchain/langchain/vectorstores/chroma.py
index 26b6a1da8c..86bd274dba 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