Skip to content

The agent engineering platform.

(Chroma): Small Fix in `add_texts` when checking for embeddings (#29766)

Mohammad Mohtashim2310847c0f81
diff --git a/libs/partners/chroma/langchain_chroma/vectorstores.py b/libs/partners/chroma/langchain_chroma/vectorstores.py
index 121f412ca3..ccb175be9d 100644
--- a/libs/partners/chroma/langchain_chroma/vectorstores.py
+++ b/libs/partners/chroma/langchain_chroma/vectorstores.py
@@ -547,7 +547,9 @@ class Chroma(VectorStore):
metadatas = [metadatas[idx] for idx in non_empty_ids]
texts_with_metadatas = [texts[idx] for idx in non_empty_ids]
embeddings_with_metadatas = (
- [embeddings[idx] for idx in non_empty_ids] if embeddings else None
+ [embeddings[idx] for idx in non_empty_ids]
+ if embeddings is not None
+ else None
)
ids_with_metadata = [ids[idx] for idx in non_empty_ids]
try: