chroma-haystack 2.0.1__tar.gz → 2.0.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {chroma_haystack-2.0.1 → chroma_haystack-2.0.2}/CHANGELOG.md +17 -0
- {chroma_haystack-2.0.1 → chroma_haystack-2.0.2}/PKG-INFO +5 -3
- {chroma_haystack-2.0.1 → chroma_haystack-2.0.2}/pyproject.toml +3 -7
- {chroma_haystack-2.0.1 → chroma_haystack-2.0.2}/src/haystack_integrations/document_stores/chroma/document_store.py +16 -19
- {chroma_haystack-2.0.1 → chroma_haystack-2.0.2}/tests/test_document_store.py +4 -4
- {chroma_haystack-2.0.1 → chroma_haystack-2.0.2}/.gitignore +0 -0
- {chroma_haystack-2.0.1 → chroma_haystack-2.0.2}/LICENSE +0 -0
- {chroma_haystack-2.0.1 → chroma_haystack-2.0.2}/README.md +0 -0
- {chroma_haystack-2.0.1 → chroma_haystack-2.0.2}/example/data/usr_01.txt +0 -0
- {chroma_haystack-2.0.1 → chroma_haystack-2.0.2}/example/data/usr_02.txt +0 -0
- {chroma_haystack-2.0.1 → chroma_haystack-2.0.2}/example/data/usr_03.txt +0 -0
- {chroma_haystack-2.0.1 → chroma_haystack-2.0.2}/example/data/usr_04.txt +0 -0
- {chroma_haystack-2.0.1 → chroma_haystack-2.0.2}/example/data/usr_05.txt +0 -0
- {chroma_haystack-2.0.1 → chroma_haystack-2.0.2}/example/data/usr_06.txt +0 -0
- {chroma_haystack-2.0.1 → chroma_haystack-2.0.2}/example/data/usr_07.txt +0 -0
- {chroma_haystack-2.0.1 → chroma_haystack-2.0.2}/example/data/usr_08.txt +0 -0
- {chroma_haystack-2.0.1 → chroma_haystack-2.0.2}/example/data/usr_09.txt +0 -0
- {chroma_haystack-2.0.1 → chroma_haystack-2.0.2}/example/data/usr_10.txt +0 -0
- {chroma_haystack-2.0.1 → chroma_haystack-2.0.2}/example/data/usr_11.txt +0 -0
- {chroma_haystack-2.0.1 → chroma_haystack-2.0.2}/example/data/usr_12.txt +0 -0
- {chroma_haystack-2.0.1 → chroma_haystack-2.0.2}/example/data/usr_20.txt +0 -0
- {chroma_haystack-2.0.1 → chroma_haystack-2.0.2}/example/data/usr_21.txt +0 -0
- {chroma_haystack-2.0.1 → chroma_haystack-2.0.2}/example/data/usr_22.txt +0 -0
- {chroma_haystack-2.0.1 → chroma_haystack-2.0.2}/example/data/usr_23.txt +0 -0
- {chroma_haystack-2.0.1 → chroma_haystack-2.0.2}/example/data/usr_24.txt +0 -0
- {chroma_haystack-2.0.1 → chroma_haystack-2.0.2}/example/data/usr_25.txt +0 -0
- {chroma_haystack-2.0.1 → chroma_haystack-2.0.2}/example/data/usr_26.txt +0 -0
- {chroma_haystack-2.0.1 → chroma_haystack-2.0.2}/example/data/usr_27.txt +0 -0
- {chroma_haystack-2.0.1 → chroma_haystack-2.0.2}/example/data/usr_28.txt +0 -0
- {chroma_haystack-2.0.1 → chroma_haystack-2.0.2}/example/data/usr_29.txt +0 -0
- {chroma_haystack-2.0.1 → chroma_haystack-2.0.2}/example/data/usr_30.txt +0 -0
- {chroma_haystack-2.0.1 → chroma_haystack-2.0.2}/example/data/usr_31.txt +0 -0
- {chroma_haystack-2.0.1 → chroma_haystack-2.0.2}/example/data/usr_32.txt +0 -0
- {chroma_haystack-2.0.1 → chroma_haystack-2.0.2}/example/data/usr_40.txt +0 -0
- {chroma_haystack-2.0.1 → chroma_haystack-2.0.2}/example/data/usr_41.txt +0 -0
- {chroma_haystack-2.0.1 → chroma_haystack-2.0.2}/example/data/usr_42.txt +0 -0
- {chroma_haystack-2.0.1 → chroma_haystack-2.0.2}/example/data/usr_43.txt +0 -0
- {chroma_haystack-2.0.1 → chroma_haystack-2.0.2}/example/data/usr_44.txt +0 -0
- {chroma_haystack-2.0.1 → chroma_haystack-2.0.2}/example/data/usr_45.txt +0 -0
- {chroma_haystack-2.0.1 → chroma_haystack-2.0.2}/example/data/usr_46.txt +0 -0
- {chroma_haystack-2.0.1 → chroma_haystack-2.0.2}/example/data/usr_50.txt +0 -0
- {chroma_haystack-2.0.1 → chroma_haystack-2.0.2}/example/data/usr_51.txt +0 -0
- {chroma_haystack-2.0.1 → chroma_haystack-2.0.2}/example/data/usr_52.txt +0 -0
- {chroma_haystack-2.0.1 → chroma_haystack-2.0.2}/example/data/usr_90.txt +0 -0
- {chroma_haystack-2.0.1 → chroma_haystack-2.0.2}/example/example.py +0 -0
- {chroma_haystack-2.0.1 → chroma_haystack-2.0.2}/pydoc/config.yml +0 -0
- {chroma_haystack-2.0.1 → chroma_haystack-2.0.2}/src/haystack_integrations/components/retrievers/chroma/__init__.py +0 -0
- {chroma_haystack-2.0.1 → chroma_haystack-2.0.2}/src/haystack_integrations/components/retrievers/chroma/retriever.py +0 -0
- {chroma_haystack-2.0.1 → chroma_haystack-2.0.2}/src/haystack_integrations/document_stores/chroma/__init__.py +0 -0
- {chroma_haystack-2.0.1 → chroma_haystack-2.0.2}/src/haystack_integrations/document_stores/chroma/errors.py +0 -0
- {chroma_haystack-2.0.1 → chroma_haystack-2.0.2}/src/haystack_integrations/document_stores/chroma/filters.py +0 -0
- {chroma_haystack-2.0.1 → chroma_haystack-2.0.2}/src/haystack_integrations/document_stores/chroma/utils.py +0 -0
- {chroma_haystack-2.0.1 → chroma_haystack-2.0.2}/tests/__init__.py +0 -0
- {chroma_haystack-2.0.1 → chroma_haystack-2.0.2}/tests/test_retriever.py +0 -0
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [integrations/chroma-v3.0.0] - 2025-03-11
|
|
4
|
+
|
|
5
|
+
### 🧹 Chores
|
|
6
|
+
|
|
7
|
+
- Use Haystack logging across integrations (#1484)
|
|
8
|
+
|
|
9
|
+
### 🌀 Miscellaneous
|
|
10
|
+
|
|
11
|
+
- Fix: Chroma - relax dataframe/blob test (#1404)
|
|
12
|
+
- Pin haystack and remove dataframe checks (#1501)
|
|
13
|
+
|
|
14
|
+
## [integrations/chroma-v2.0.1] - 2025-02-14
|
|
15
|
+
|
|
16
|
+
### 🌀 Miscellaneous
|
|
17
|
+
|
|
18
|
+
- Better handle discarded fields (#1373)
|
|
19
|
+
|
|
3
20
|
## [integrations/chroma-v1.0.1] - 2025-02-14
|
|
4
21
|
|
|
5
22
|
### 🧹 Chores
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: chroma-haystack
|
|
3
|
-
Version: 2.0.
|
|
3
|
+
Version: 2.0.2
|
|
4
4
|
Project-URL: Documentation, https://github.com/deepset-ai/haystack-core-integrations/tree/main/integrations/chroma#readme
|
|
5
5
|
Project-URL: Issues, https://github.com/deepset-ai/haystack-core-integrations/issues
|
|
6
6
|
Project-URL: Source, https://github.com/deepset-ai/haystack-core-integrations/tree/main/integrations/chroma
|
|
@@ -13,11 +13,13 @@ Classifier: Programming Language :: Python
|
|
|
13
13
|
Classifier: Programming Language :: Python :: 3.9
|
|
14
14
|
Classifier: Programming Language :: Python :: 3.10
|
|
15
15
|
Classifier: Programming Language :: Python :: 3.11
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
16
18
|
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
17
19
|
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
18
20
|
Requires-Python: >=3.9
|
|
19
|
-
Requires-Dist: chromadb
|
|
20
|
-
Requires-Dist: haystack-ai
|
|
21
|
+
Requires-Dist: chromadb<1,>=0.6.0
|
|
22
|
+
Requires-Dist: haystack-ai>=2.11.0
|
|
21
23
|
Description-Content-Type: text/markdown
|
|
22
24
|
|
|
23
25
|
# Chroma Document Store for Haystack
|
|
@@ -18,13 +18,12 @@ classifiers = [
|
|
|
18
18
|
"Programming Language :: Python :: 3.9",
|
|
19
19
|
"Programming Language :: Python :: 3.10",
|
|
20
20
|
"Programming Language :: Python :: 3.11",
|
|
21
|
+
"Programming Language :: Python :: 3.12",
|
|
22
|
+
"Programming Language :: Python :: 3.13",
|
|
21
23
|
"Programming Language :: Python :: Implementation :: CPython",
|
|
22
24
|
"Programming Language :: Python :: Implementation :: PyPy",
|
|
23
25
|
]
|
|
24
|
-
dependencies = [
|
|
25
|
-
"haystack-ai",
|
|
26
|
-
"chromadb>=0.6.0",
|
|
27
|
-
]
|
|
26
|
+
dependencies = ["haystack-ai>=2.11.0", "chromadb>=0.6.0,<1"]
|
|
28
27
|
|
|
29
28
|
[project.urls]
|
|
30
29
|
Documentation = "https://github.com/deepset-ai/haystack-core-integrations/tree/main/integrations/chroma#readme"
|
|
@@ -60,9 +59,6 @@ cov = ["test-cov", "cov-report"]
|
|
|
60
59
|
cov-retry = ["test-cov-retry", "cov-report"]
|
|
61
60
|
docs = ["pydoc-markdown pydoc/config.yml"]
|
|
62
61
|
|
|
63
|
-
[[tool.hatch.envs.all.matrix]]
|
|
64
|
-
python = ["3.9", "3.10"]
|
|
65
|
-
|
|
66
62
|
[tool.hatch.envs.lint]
|
|
67
63
|
installer = "uv"
|
|
68
64
|
detached = true
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
# SPDX-FileCopyrightText: 2023-present John Doe <jd@example.com>
|
|
2
2
|
#
|
|
3
3
|
# SPDX-License-Identifier: Apache-2.0
|
|
4
|
-
import logging
|
|
5
4
|
from typing import Any, Dict, List, Literal, Optional
|
|
6
5
|
|
|
7
6
|
import chromadb
|
|
8
7
|
from chromadb.api.types import GetResult, QueryResult
|
|
9
|
-
from haystack import default_from_dict, default_to_dict
|
|
8
|
+
from haystack import default_from_dict, default_to_dict, logging
|
|
10
9
|
from haystack.dataclasses import Document
|
|
11
10
|
from haystack.document_stores.types import DuplicatePolicy
|
|
12
11
|
from numpy import ndarray
|
|
@@ -250,18 +249,16 @@ class ChromaDocumentStore:
|
|
|
250
249
|
if doc.content is None:
|
|
251
250
|
logger.warning(
|
|
252
251
|
"ChromaDocumentStore cannot store documents with `content=None`. "
|
|
253
|
-
"Document with id
|
|
254
|
-
doc.id,
|
|
252
|
+
"Document with id {doc_id} will be skipped.",
|
|
253
|
+
doc_id=doc.id,
|
|
255
254
|
)
|
|
256
255
|
continue
|
|
257
|
-
elif
|
|
258
|
-
hasattr(doc, "blob") and doc.blob is not None
|
|
259
|
-
):
|
|
256
|
+
elif hasattr(doc, "blob") and doc.blob is not None:
|
|
260
257
|
logger.warning(
|
|
261
|
-
"Document with id
|
|
262
|
-
"ChromaDocumentStore cannot store `
|
|
263
|
-
"
|
|
264
|
-
doc.id,
|
|
258
|
+
"Document with id {doc_id} contains the `blob` field. "
|
|
259
|
+
"ChromaDocumentStore cannot store `blob` fields. "
|
|
260
|
+
"This field will be ignored.",
|
|
261
|
+
doc_id=doc.id,
|
|
265
262
|
)
|
|
266
263
|
data = {"ids": [doc.id], "documents": [doc.content]}
|
|
267
264
|
|
|
@@ -277,11 +274,11 @@ class ChromaDocumentStore:
|
|
|
277
274
|
|
|
278
275
|
if discarded_keys:
|
|
279
276
|
logger.warning(
|
|
280
|
-
"Document
|
|
281
|
-
"These items will be discarded. Supported types are:
|
|
282
|
-
doc.id,
|
|
283
|
-
", ".join(discarded_keys),
|
|
284
|
-
", ".join([t.__name__ for t in SUPPORTED_TYPES_FOR_METADATA_VALUES]),
|
|
277
|
+
"Document {doc_id} contains `meta` values of unsupported types for the keys: {keys}. "
|
|
278
|
+
"These items will be discarded. Supported types are: {types}.",
|
|
279
|
+
doc_id=doc.id,
|
|
280
|
+
keys=", ".join(discarded_keys),
|
|
281
|
+
types=", ".join([t.__name__ for t in SUPPORTED_TYPES_FOR_METADATA_VALUES]),
|
|
285
282
|
)
|
|
286
283
|
|
|
287
284
|
if valid_meta:
|
|
@@ -292,10 +289,10 @@ class ChromaDocumentStore:
|
|
|
292
289
|
|
|
293
290
|
if hasattr(doc, "sparse_embedding") and doc.sparse_embedding is not None:
|
|
294
291
|
logger.warning(
|
|
295
|
-
"Document
|
|
296
|
-
"but storing sparse embeddings in Chroma is not currently supported."
|
|
292
|
+
"Document {doc_id} has the `sparse_embedding` field set, "
|
|
293
|
+
"but storing sparse embeddings in Chroma is not currently supported. "
|
|
297
294
|
"The `sparse_embedding` field will be ignored.",
|
|
298
|
-
doc.id,
|
|
295
|
+
doc_id=doc.id,
|
|
299
296
|
)
|
|
300
297
|
|
|
301
298
|
self._collection.add(**data)
|
|
@@ -237,15 +237,15 @@ class TestDocumentStore(CountDocumentsTest, DeleteDocumentsTest, FilterDocuments
|
|
|
237
237
|
document_store.write_documents([Document(content=None)])
|
|
238
238
|
assert document_store.filter_documents() == []
|
|
239
239
|
|
|
240
|
-
def
|
|
240
|
+
def test_blob_not_stored(self, document_store: ChromaDocumentStore):
|
|
241
241
|
bs = ByteStream(data=b"test")
|
|
242
242
|
doc_mixed = Document(content="test", blob=bs)
|
|
243
|
-
doc_mixed.dataframe = "non null content" # just a placeholder
|
|
244
243
|
|
|
245
244
|
document_store.write_documents([doc_mixed])
|
|
246
245
|
|
|
247
|
-
|
|
248
|
-
assert
|
|
246
|
+
retrieved_doc = document_store.filter_documents()[0]
|
|
247
|
+
assert retrieved_doc.content == "test"
|
|
248
|
+
assert retrieved_doc.blob is None
|
|
249
249
|
|
|
250
250
|
@pytest.mark.integration
|
|
251
251
|
def test_to_dict(self, request):
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|