qdrant-haystack 7.0.0__py3-none-any.whl → 8.1.0__py3-none-any.whl
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.
- haystack_integrations/components/retrievers/qdrant/__init__.py +1 -1
- haystack_integrations/document_stores/qdrant/converters.py +17 -0
- haystack_integrations/document_stores/qdrant/document_store.py +15 -7
- {qdrant_haystack-7.0.0.dist-info → qdrant_haystack-8.1.0.dist-info}/METADATA +4 -4
- {qdrant_haystack-7.0.0.dist-info → qdrant_haystack-8.1.0.dist-info}/RECORD +7 -7
- {qdrant_haystack-7.0.0.dist-info → qdrant_haystack-8.1.0.dist-info}/WHEEL +1 -1
- {qdrant_haystack-7.0.0.dist-info → qdrant_haystack-8.1.0.dist-info}/licenses/LICENSE.txt +0 -0
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
|
|
5
5
|
from .retriever import QdrantEmbeddingRetriever, QdrantHybridRetriever, QdrantSparseEmbeddingRetriever
|
|
6
6
|
|
|
7
|
-
__all__ = ("QdrantEmbeddingRetriever", "
|
|
7
|
+
__all__ = ("QdrantEmbeddingRetriever", "QdrantHybridRetriever", "QdrantSparseEmbeddingRetriever")
|
|
@@ -22,6 +22,15 @@ def convert_haystack_documents_to_qdrant_points(
|
|
|
22
22
|
points = []
|
|
23
23
|
for document in documents:
|
|
24
24
|
payload = document.to_dict(flatten=False)
|
|
25
|
+
|
|
26
|
+
if payload.pop("dataframe", None):
|
|
27
|
+
logger.warning(
|
|
28
|
+
"Document %s has the `dataframe` field set,"
|
|
29
|
+
"QdrantDocumentStore no longer supports dataframes and this field will be ignored. "
|
|
30
|
+
"The `dataframe` field will soon be removed from Haystack Document.",
|
|
31
|
+
document.id,
|
|
32
|
+
)
|
|
33
|
+
|
|
25
34
|
if use_sparse_embeddings:
|
|
26
35
|
vector = {}
|
|
27
36
|
|
|
@@ -64,6 +73,14 @@ def convert_qdrant_point_to_haystack_document(point: QdrantPoint, use_sparse_emb
|
|
|
64
73
|
payload = {**point.payload}
|
|
65
74
|
payload["score"] = point.score if hasattr(point, "score") else None
|
|
66
75
|
|
|
76
|
+
if payload.pop("dataframe", None):
|
|
77
|
+
logger.warning(
|
|
78
|
+
"Document %s has the `dataframe` field set,"
|
|
79
|
+
"QdrantDocumentStore no longer supports dataframes and this field will be ignored. "
|
|
80
|
+
"The `dataframe` field will soon be removed from Haystack Document.",
|
|
81
|
+
payload["id"],
|
|
82
|
+
)
|
|
83
|
+
|
|
67
84
|
if not use_sparse_embeddings:
|
|
68
85
|
payload["embedding"] = point.vector if hasattr(point, "vector") else None
|
|
69
86
|
elif hasattr(point, "vector") and point.vector is not None:
|
|
@@ -48,8 +48,8 @@ def get_batches_from_generator(iterable, n):
|
|
|
48
48
|
|
|
49
49
|
class QdrantDocumentStore:
|
|
50
50
|
"""
|
|
51
|
-
QdrantDocumentStore
|
|
52
|
-
|
|
51
|
+
A QdrantDocumentStore implementation that you
|
|
52
|
+
can use with any Qdrant instance: in-memory, disk-persisted, Docker-based,
|
|
53
53
|
and Qdrant Cloud Cluster deployments.
|
|
54
54
|
|
|
55
55
|
Usage example by creating an in-memory instance:
|
|
@@ -866,10 +866,18 @@ class QdrantDocumentStore:
|
|
|
866
866
|
|
|
867
867
|
collection_info = self.client.get_collection(collection_name)
|
|
868
868
|
|
|
869
|
-
has_named_vectors = (
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
869
|
+
has_named_vectors = isinstance(collection_info.config.params.vectors, dict)
|
|
870
|
+
|
|
871
|
+
if has_named_vectors and DENSE_VECTORS_NAME not in collection_info.config.params.vectors:
|
|
872
|
+
msg = (
|
|
873
|
+
f"Collection '{collection_name}' already exists in Qdrant, "
|
|
874
|
+
f"but it has been originally created outside of Haystack and is not supported. "
|
|
875
|
+
f"If possible, you should create a new Document Store with Haystack. "
|
|
876
|
+
f"In case you want to migrate the existing collection, see an example script in "
|
|
877
|
+
f"https://github.com/deepset-ai/haystack-core-integrations/blob/main/integrations/qdrant/src/"
|
|
878
|
+
f"haystack_integrations/document_stores/qdrant/migrate_to_sparse.py."
|
|
879
|
+
)
|
|
880
|
+
raise QdrantStoreError(msg)
|
|
873
881
|
|
|
874
882
|
if self.use_sparse_embeddings and not has_named_vectors:
|
|
875
883
|
msg = (
|
|
@@ -882,7 +890,7 @@ class QdrantDocumentStore:
|
|
|
882
890
|
)
|
|
883
891
|
raise QdrantStoreError(msg)
|
|
884
892
|
|
|
885
|
-
|
|
893
|
+
if not self.use_sparse_embeddings and has_named_vectors:
|
|
886
894
|
msg = (
|
|
887
895
|
f"Collection '{collection_name}' already exists in Qdrant, "
|
|
888
896
|
f"but it has been originally created with sparse embedding vectors."
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: qdrant-haystack
|
|
3
|
-
Version:
|
|
3
|
+
Version: 8.1.0
|
|
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
|
|
@@ -11,13 +11,13 @@ License-File: LICENSE.txt
|
|
|
11
11
|
Classifier: Development Status :: 4 - Beta
|
|
12
12
|
Classifier: License :: OSI Approved :: Apache Software License
|
|
13
13
|
Classifier: Programming Language :: Python
|
|
14
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
15
14
|
Classifier: Programming Language :: Python :: 3.9
|
|
16
15
|
Classifier: Programming Language :: Python :: 3.10
|
|
17
16
|
Classifier: Programming Language :: Python :: 3.11
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
18
18
|
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
19
19
|
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
20
|
-
Requires-Python: >=3.
|
|
20
|
+
Requires-Python: >=3.9
|
|
21
21
|
Requires-Dist: haystack-ai
|
|
22
22
|
Requires-Dist: qdrant-client>=1.10.0
|
|
23
23
|
Description-Content-Type: text/markdown
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
haystack_integrations/components/retrievers/qdrant/__init__.py,sha256=
|
|
1
|
+
haystack_integrations/components/retrievers/qdrant/__init__.py,sha256=AE1hdw4sqb0rTSqfAxKCRUOZVE8gbHdQ1wDccdN86hc,313
|
|
2
2
|
haystack_integrations/components/retrievers/qdrant/retriever.py,sha256=VsQVsvf79imTCdWUKikUxpjczl5oxOV64a91aGXZwpE,21997
|
|
3
3
|
haystack_integrations/document_stores/qdrant/__init__.py,sha256=kUGc5uewqArhmVR-JqB_NmJ4kNkTIQIvYDNSoO2ELn0,302
|
|
4
|
-
haystack_integrations/document_stores/qdrant/converters.py,sha256=
|
|
5
|
-
haystack_integrations/document_stores/qdrant/document_store.py,sha256=
|
|
4
|
+
haystack_integrations/document_stores/qdrant/converters.py,sha256=ndFZjMjweJJDyC_994zDX4BGhGcW1SfLf79zBeyUits,3192
|
|
5
|
+
haystack_integrations/document_stores/qdrant/document_store.py,sha256=Ir5caEvPDn_YaqXdY9nm6LuCGwXv2QsqY3ErizHrQ6I,42860
|
|
6
6
|
haystack_integrations/document_stores/qdrant/filters.py,sha256=Nv_eKIYKwUWvldJfa0omfFQ0kgqi6L3DUFeMuIWziOY,11751
|
|
7
7
|
haystack_integrations/document_stores/qdrant/migrate_to_sparse.py,sha256=yhZr4GB6N1S-Ikzl52hpuZt2aHNIb4leqFDhVMU3Uho,4910
|
|
8
|
-
qdrant_haystack-
|
|
9
|
-
qdrant_haystack-
|
|
10
|
-
qdrant_haystack-
|
|
11
|
-
qdrant_haystack-
|
|
8
|
+
qdrant_haystack-8.1.0.dist-info/METADATA,sha256=i64F7-YjiwGSMMZBMl2liBHPpIzptjmBooHuxMjBq2Q,1864
|
|
9
|
+
qdrant_haystack-8.1.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
10
|
+
qdrant_haystack-8.1.0.dist-info/licenses/LICENSE.txt,sha256=B05uMshqTA74s-0ltyHKI6yoPfJ3zYgQbvcXfDVGFf8,10280
|
|
11
|
+
qdrant_haystack-8.1.0.dist-info/RECORD,,
|
|
File without changes
|