qdrant-haystack 4.1.1__tar.gz → 4.1.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.
Potentially problematic release.
This version of qdrant-haystack might be problematic. Click here for more details.
- {qdrant_haystack-4.1.1 → qdrant_haystack-4.1.2}/CHANGELOG.md +10 -0
- {qdrant_haystack-4.1.1 → qdrant_haystack-4.1.2}/PKG-INFO +1 -1
- {qdrant_haystack-4.1.1 → qdrant_haystack-4.1.2}/src/haystack_integrations/components/retrievers/qdrant/retriever.py +12 -3
- {qdrant_haystack-4.1.1 → qdrant_haystack-4.1.2}/tests/test_retriever.py +48 -0
- {qdrant_haystack-4.1.1 → qdrant_haystack-4.1.2}/.gitignore +0 -0
- {qdrant_haystack-4.1.1 → qdrant_haystack-4.1.2}/LICENSE.txt +0 -0
- {qdrant_haystack-4.1.1 → qdrant_haystack-4.1.2}/README.md +0 -0
- {qdrant_haystack-4.1.1 → qdrant_haystack-4.1.2}/examples/embedding_retrieval.py +0 -0
- {qdrant_haystack-4.1.1 → qdrant_haystack-4.1.2}/pydoc/config.yml +0 -0
- {qdrant_haystack-4.1.1 → qdrant_haystack-4.1.2}/pyproject.toml +0 -0
- {qdrant_haystack-4.1.1 → qdrant_haystack-4.1.2}/src/haystack_integrations/components/retrievers/qdrant/__init__.py +0 -0
- {qdrant_haystack-4.1.1 → qdrant_haystack-4.1.2}/src/haystack_integrations/document_stores/qdrant/__init__.py +0 -0
- {qdrant_haystack-4.1.1 → qdrant_haystack-4.1.2}/src/haystack_integrations/document_stores/qdrant/converters.py +0 -0
- {qdrant_haystack-4.1.1 → qdrant_haystack-4.1.2}/src/haystack_integrations/document_stores/qdrant/document_store.py +0 -0
- {qdrant_haystack-4.1.1 → qdrant_haystack-4.1.2}/src/haystack_integrations/document_stores/qdrant/filters.py +0 -0
- {qdrant_haystack-4.1.1 → qdrant_haystack-4.1.2}/src/haystack_integrations/document_stores/qdrant/migrate_to_sparse.py +0 -0
- {qdrant_haystack-4.1.1 → qdrant_haystack-4.1.2}/tests/__init__.py +0 -0
- {qdrant_haystack-4.1.1 → qdrant_haystack-4.1.2}/tests/conftest.py +0 -0
- {qdrant_haystack-4.1.1 → qdrant_haystack-4.1.2}/tests/test_converters.py +0 -0
- {qdrant_haystack-4.1.1 → qdrant_haystack-4.1.2}/tests/test_dict_converters.py +0 -0
- {qdrant_haystack-4.1.1 → qdrant_haystack-4.1.2}/tests/test_document_store.py +0 -0
- {qdrant_haystack-4.1.1 → qdrant_haystack-4.1.2}/tests/test_filters.py +0 -0
- {qdrant_haystack-4.1.1 → qdrant_haystack-4.1.2}/tests/test_legacy_filters.py +0 -0
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [integrations/qdrant-v4.1.1] - 2024-07-10
|
|
4
|
+
|
|
5
|
+
### 🚀 Features
|
|
6
|
+
|
|
7
|
+
- Add filter_policy to qdrant integration (#819)
|
|
8
|
+
|
|
9
|
+
### 🐛 Bug Fixes
|
|
10
|
+
|
|
11
|
+
- Errors in convert_filters_to_qdrant (#870)
|
|
12
|
+
|
|
3
13
|
## [integrations/qdrant-v4.1.0] - 2024-07-03
|
|
4
14
|
|
|
5
15
|
### 🚀 Features
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: qdrant-haystack
|
|
3
|
-
Version: 4.1.
|
|
3
|
+
Version: 4.1.2
|
|
4
4
|
Summary: An integration of Qdrant ANN vector database backend with Haystack
|
|
5
5
|
Project-URL: Source, https://github.com/deepset-ai/haystack-core-integrations
|
|
6
6
|
Project-URL: Documentation, https://github.com/deepset-ai/haystack-core-integrations/blob/main/integrations/qdrant/README.md
|
|
@@ -108,7 +108,10 @@ class QdrantEmbeddingRetriever:
|
|
|
108
108
|
"""
|
|
109
109
|
document_store = QdrantDocumentStore.from_dict(data["init_parameters"]["document_store"])
|
|
110
110
|
data["init_parameters"]["document_store"] = document_store
|
|
111
|
-
|
|
111
|
+
# Pipelines serialized with old versions of the component might not
|
|
112
|
+
# have the filter_policy field.
|
|
113
|
+
if filter_policy := data["init_parameters"].get("filter_policy"):
|
|
114
|
+
data["init_parameters"]["filter_policy"] = FilterPolicy.from_str(filter_policy)
|
|
112
115
|
return default_from_dict(cls, data)
|
|
113
116
|
|
|
114
117
|
@component.output_types(documents=List[Document])
|
|
@@ -249,7 +252,10 @@ class QdrantSparseEmbeddingRetriever:
|
|
|
249
252
|
"""
|
|
250
253
|
document_store = QdrantDocumentStore.from_dict(data["init_parameters"]["document_store"])
|
|
251
254
|
data["init_parameters"]["document_store"] = document_store
|
|
252
|
-
|
|
255
|
+
# Pipelines serialized with old versions of the component might not
|
|
256
|
+
# have the filter_policy field.
|
|
257
|
+
if filter_policy := data["init_parameters"].get("filter_policy"):
|
|
258
|
+
data["init_parameters"]["filter_policy"] = FilterPolicy.from_str(filter_policy)
|
|
253
259
|
return default_from_dict(cls, data)
|
|
254
260
|
|
|
255
261
|
@component.output_types(documents=List[Document])
|
|
@@ -394,7 +400,10 @@ class QdrantHybridRetriever:
|
|
|
394
400
|
"""
|
|
395
401
|
document_store = QdrantDocumentStore.from_dict(data["init_parameters"]["document_store"])
|
|
396
402
|
data["init_parameters"]["document_store"] = document_store
|
|
397
|
-
|
|
403
|
+
# Pipelines serialized with old versions of the component might not
|
|
404
|
+
# have the filter_policy field.
|
|
405
|
+
if filter_policy := data["init_parameters"].get("filter_policy"):
|
|
406
|
+
data["init_parameters"]["filter_policy"] = FilterPolicy.from_str(filter_policy)
|
|
398
407
|
return default_from_dict(cls, data)
|
|
399
408
|
|
|
400
409
|
@component.output_types(documents=List[Document])
|
|
@@ -296,6 +296,31 @@ class TestQdrantSparseEmbeddingRetriever(FilterableDocsFixtureMixin):
|
|
|
296
296
|
assert retriever._return_embedding is True
|
|
297
297
|
assert retriever._score_threshold is None
|
|
298
298
|
|
|
299
|
+
def test_from_dict_no_filter_policy(self):
|
|
300
|
+
data = {
|
|
301
|
+
"type": "haystack_integrations.components.retrievers.qdrant.retriever.QdrantSparseEmbeddingRetriever",
|
|
302
|
+
"init_parameters": {
|
|
303
|
+
"document_store": {
|
|
304
|
+
"init_parameters": {"location": ":memory:", "index": "test"},
|
|
305
|
+
"type": "haystack_integrations.document_stores.qdrant.document_store.QdrantDocumentStore",
|
|
306
|
+
},
|
|
307
|
+
"filters": None,
|
|
308
|
+
"top_k": 5,
|
|
309
|
+
"scale_score": False,
|
|
310
|
+
"return_embedding": True,
|
|
311
|
+
"score_threshold": None,
|
|
312
|
+
},
|
|
313
|
+
}
|
|
314
|
+
retriever = QdrantSparseEmbeddingRetriever.from_dict(data)
|
|
315
|
+
assert isinstance(retriever._document_store, QdrantDocumentStore)
|
|
316
|
+
assert retriever._document_store.index == "test"
|
|
317
|
+
assert retriever._filters is None
|
|
318
|
+
assert retriever._top_k == 5
|
|
319
|
+
assert retriever._filter_policy == FilterPolicy.REPLACE # defaults to REPLACE
|
|
320
|
+
assert retriever._scale_score is False
|
|
321
|
+
assert retriever._return_embedding is True
|
|
322
|
+
assert retriever._score_threshold is None
|
|
323
|
+
|
|
299
324
|
def test_run(self, filterable_docs: List[Document], generate_sparse_embedding):
|
|
300
325
|
document_store = QdrantDocumentStore(location=":memory:", index="Boi", use_sparse_embeddings=True)
|
|
301
326
|
|
|
@@ -414,6 +439,29 @@ class TestQdrantHybridRetriever:
|
|
|
414
439
|
assert retriever._return_embedding
|
|
415
440
|
assert retriever._score_threshold is None
|
|
416
441
|
|
|
442
|
+
def test_from_dict_no_filter_policy(self):
|
|
443
|
+
data = {
|
|
444
|
+
"type": "haystack_integrations.components.retrievers.qdrant.retriever.QdrantHybridRetriever",
|
|
445
|
+
"init_parameters": {
|
|
446
|
+
"document_store": {
|
|
447
|
+
"init_parameters": {"location": ":memory:", "index": "test"},
|
|
448
|
+
"type": "haystack_integrations.document_stores.qdrant.document_store.QdrantDocumentStore",
|
|
449
|
+
},
|
|
450
|
+
"filters": None,
|
|
451
|
+
"top_k": 5,
|
|
452
|
+
"return_embedding": True,
|
|
453
|
+
"score_threshold": None,
|
|
454
|
+
},
|
|
455
|
+
}
|
|
456
|
+
retriever = QdrantHybridRetriever.from_dict(data)
|
|
457
|
+
assert isinstance(retriever._document_store, QdrantDocumentStore)
|
|
458
|
+
assert retriever._document_store.index == "test"
|
|
459
|
+
assert retriever._filters is None
|
|
460
|
+
assert retriever._top_k == 5
|
|
461
|
+
assert retriever._filter_policy == FilterPolicy.REPLACE # defaults to REPLACE
|
|
462
|
+
assert retriever._return_embedding
|
|
463
|
+
assert retriever._score_threshold is None
|
|
464
|
+
|
|
417
465
|
def test_run(self):
|
|
418
466
|
mock_store = Mock(spec=QdrantDocumentStore)
|
|
419
467
|
sparse_embedding = SparseEmbedding(indices=[0, 1, 2, 3], values=[0.1, 0.8, 0.05, 0.33])
|
|
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
|