qdrant-haystack 3.8.1__py3-none-any.whl → 4.0.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/retriever.py +2 -2
- haystack_integrations/document_stores/qdrant/converters.py +2 -3
- haystack_integrations/document_stores/qdrant/document_store.py +3 -25
- {qdrant_haystack-3.8.1.dist-info → qdrant_haystack-4.0.0.dist-info}/METADATA +1 -1
- {qdrant_haystack-3.8.1.dist-info → qdrant_haystack-4.0.0.dist-info}/RECORD +7 -7
- {qdrant_haystack-3.8.1.dist-info → qdrant_haystack-4.0.0.dist-info}/WHEEL +1 -1
- {qdrant_haystack-3.8.1.dist-info → qdrant_haystack-4.0.0.dist-info}/licenses/LICENSE.txt +0 -0
|
@@ -37,7 +37,7 @@ class QdrantEmbeddingRetriever:
|
|
|
37
37
|
document_store: QdrantDocumentStore,
|
|
38
38
|
filters: Optional[Union[Dict[str, Any], models.Filter]] = None,
|
|
39
39
|
top_k: int = 10,
|
|
40
|
-
scale_score: bool =
|
|
40
|
+
scale_score: bool = False,
|
|
41
41
|
return_embedding: bool = False,
|
|
42
42
|
):
|
|
43
43
|
"""
|
|
@@ -159,7 +159,7 @@ class QdrantSparseEmbeddingRetriever:
|
|
|
159
159
|
document_store: QdrantDocumentStore,
|
|
160
160
|
filters: Optional[Union[Dict[str, Any], models.Filter]] = None,
|
|
161
161
|
top_k: int = 10,
|
|
162
|
-
scale_score: bool =
|
|
162
|
+
scale_score: bool = False,
|
|
163
163
|
return_embedding: bool = False,
|
|
164
164
|
):
|
|
165
165
|
"""
|
|
@@ -17,7 +17,6 @@ UUID_NAMESPACE = uuid.UUID("3896d314-1e95-4a3a-b45a-945f9f0b541d")
|
|
|
17
17
|
def convert_haystack_documents_to_qdrant_points(
|
|
18
18
|
documents: List[Document],
|
|
19
19
|
*,
|
|
20
|
-
embedding_field: str,
|
|
21
20
|
use_sparse_embeddings: bool,
|
|
22
21
|
) -> List[rest.PointStruct]:
|
|
23
22
|
points = []
|
|
@@ -26,7 +25,7 @@ def convert_haystack_documents_to_qdrant_points(
|
|
|
26
25
|
if use_sparse_embeddings:
|
|
27
26
|
vector = {}
|
|
28
27
|
|
|
29
|
-
dense_vector = payload.pop(
|
|
28
|
+
dense_vector = payload.pop("embedding", None)
|
|
30
29
|
if dense_vector is not None:
|
|
31
30
|
vector[DENSE_VECTORS_NAME] = dense_vector
|
|
32
31
|
|
|
@@ -36,7 +35,7 @@ def convert_haystack_documents_to_qdrant_points(
|
|
|
36
35
|
vector[SPARSE_VECTORS_NAME] = sparse_vector_instance
|
|
37
36
|
|
|
38
37
|
else:
|
|
39
|
-
vector = payload.pop(
|
|
38
|
+
vector = payload.pop("embedding") or {}
|
|
40
39
|
_id = convert_id(payload.get("id"))
|
|
41
40
|
|
|
42
41
|
point = rest.PointStruct(
|
|
@@ -110,14 +110,10 @@ class QdrantDocumentStore:
|
|
|
110
110
|
index: str = "Document",
|
|
111
111
|
embedding_dim: int = 768,
|
|
112
112
|
on_disk: bool = False,
|
|
113
|
-
content_field: str = "content",
|
|
114
|
-
name_field: str = "name",
|
|
115
|
-
embedding_field: str = "embedding",
|
|
116
113
|
use_sparse_embeddings: bool = False,
|
|
117
114
|
similarity: str = "cosine",
|
|
118
115
|
return_embedding: bool = False,
|
|
119
116
|
progress_bar: bool = True,
|
|
120
|
-
duplicate_documents: str = "overwrite",
|
|
121
117
|
recreate_index: bool = False,
|
|
122
118
|
shard_number: Optional[int] = None,
|
|
123
119
|
replication_factor: Optional[int] = None,
|
|
@@ -170,12 +166,6 @@ class QdrantDocumentStore:
|
|
|
170
166
|
Dimension of the embeddings.
|
|
171
167
|
:param on_disk:
|
|
172
168
|
Whether to store the collection on disk.
|
|
173
|
-
:param content_field:
|
|
174
|
-
The field for the document content.
|
|
175
|
-
:param name_field:
|
|
176
|
-
The field for the document name.
|
|
177
|
-
:param embedding_field:
|
|
178
|
-
The field for the document embeddings.
|
|
179
169
|
:param use_sparse_embedding:
|
|
180
170
|
If set to `True`, enables support for sparse embeddings.
|
|
181
171
|
:param similarity:
|
|
@@ -184,8 +174,6 @@ class QdrantDocumentStore:
|
|
|
184
174
|
Whether to return embeddings in the search results.
|
|
185
175
|
:param progress_bar:
|
|
186
176
|
Whether to show a progress bar or not.
|
|
187
|
-
:param duplicate_documents:
|
|
188
|
-
The parameter is not used and will be removed in future release.
|
|
189
177
|
:param recreate_index:
|
|
190
178
|
Whether to recreate the index.
|
|
191
179
|
:param shard_number:
|
|
@@ -260,14 +248,10 @@ class QdrantDocumentStore:
|
|
|
260
248
|
self.use_sparse_embeddings = use_sparse_embeddings
|
|
261
249
|
self.embedding_dim = embedding_dim
|
|
262
250
|
self.on_disk = on_disk
|
|
263
|
-
self.content_field = content_field
|
|
264
|
-
self.name_field = name_field
|
|
265
|
-
self.embedding_field = embedding_field
|
|
266
251
|
self.similarity = similarity
|
|
267
252
|
self.index = index
|
|
268
253
|
self.return_embedding = return_embedding
|
|
269
254
|
self.progress_bar = progress_bar
|
|
270
|
-
self.duplicate_documents = duplicate_documents
|
|
271
255
|
self.write_batch_size = write_batch_size
|
|
272
256
|
self.scroll_size = scroll_size
|
|
273
257
|
|
|
@@ -380,7 +364,6 @@ class QdrantDocumentStore:
|
|
|
380
364
|
for document_batch in batched_documents:
|
|
381
365
|
batch = convert_haystack_documents_to_qdrant_points(
|
|
382
366
|
document_batch,
|
|
383
|
-
embedding_field=self.embedding_field,
|
|
384
367
|
use_sparse_embeddings=self.use_sparse_embeddings,
|
|
385
368
|
)
|
|
386
369
|
|
|
@@ -513,7 +496,7 @@ class QdrantDocumentStore:
|
|
|
513
496
|
query_sparse_embedding: SparseEmbedding,
|
|
514
497
|
filters: Optional[Union[Dict[str, Any], rest.Filter]] = None,
|
|
515
498
|
top_k: int = 10,
|
|
516
|
-
scale_score: bool =
|
|
499
|
+
scale_score: bool = False,
|
|
517
500
|
return_embedding: bool = False,
|
|
518
501
|
) -> List[Document]:
|
|
519
502
|
"""
|
|
@@ -570,7 +553,7 @@ class QdrantDocumentStore:
|
|
|
570
553
|
query_embedding: List[float],
|
|
571
554
|
filters: Optional[Union[Dict[str, Any], rest.Filter]] = None,
|
|
572
555
|
top_k: int = 10,
|
|
573
|
-
scale_score: bool =
|
|
556
|
+
scale_score: bool = False,
|
|
574
557
|
return_embedding: bool = False,
|
|
575
558
|
) -> List[Document]:
|
|
576
559
|
"""
|
|
@@ -891,12 +874,7 @@ class QdrantDocumentStore:
|
|
|
891
874
|
|
|
892
875
|
:param documents: A list of Haystack Document objects.
|
|
893
876
|
:param index: name of the index
|
|
894
|
-
:param
|
|
895
|
-
Parameter options : ( 'skip','overwrite','fail')
|
|
896
|
-
skip (default option): Ignore the duplicates documents.
|
|
897
|
-
overwrite: Update any existing documents with the same ID when adding documents.
|
|
898
|
-
fail: An error is raised if the document ID of the document being added already
|
|
899
|
-
exists.
|
|
877
|
+
:param policy: The duplicate policy to use when writing documents.
|
|
900
878
|
:returns: A list of Haystack Document objects.
|
|
901
879
|
"""
|
|
902
880
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: qdrant-haystack
|
|
3
|
-
Version:
|
|
3
|
+
Version: 4.0.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
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
haystack_integrations/components/retrievers/qdrant/__init__.py,sha256=IRjcM4f8b5eKFEMn8tn6h6RrfslEGP3WafU7mrzNzQM,313
|
|
2
|
-
haystack_integrations/components/retrievers/qdrant/retriever.py,sha256=
|
|
2
|
+
haystack_integrations/components/retrievers/qdrant/retriever.py,sha256=_6noYJ0M71shgoTOywIgSuGQtB-CBhwRW_zUFiYIOTw,13465
|
|
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=2hcuI3kty1dVHzX1WGXxEtlrnZ9E8TAG56XATCFa6Pw,2491
|
|
5
|
+
haystack_integrations/document_stores/qdrant/document_store.py,sha256=mjzv6Z3iE9oFRil_PVLjmEq-vX7a7ULpT5afGsU7iSU,36088
|
|
6
6
|
haystack_integrations/document_stores/qdrant/filters.py,sha256=0w70Wa3Za1fNdbJ5O95sZDIpXfblJG_sBBUv0JTQ0-o,8337
|
|
7
7
|
haystack_integrations/document_stores/qdrant/migrate_to_sparse.py,sha256=i6wBC_9_JVzYZtqKm3dhHKTxhwNdcAdpgki8GABDp1c,4909
|
|
8
|
-
qdrant_haystack-
|
|
9
|
-
qdrant_haystack-
|
|
10
|
-
qdrant_haystack-
|
|
11
|
-
qdrant_haystack-
|
|
8
|
+
qdrant_haystack-4.0.0.dist-info/METADATA,sha256=wHvVJIDCQDPFLX8fL_d11zNMZul4U6r02bVhhCdmitk,1862
|
|
9
|
+
qdrant_haystack-4.0.0.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
|
|
10
|
+
qdrant_haystack-4.0.0.dist-info/licenses/LICENSE.txt,sha256=B05uMshqTA74s-0ltyHKI6yoPfJ3zYgQbvcXfDVGFf8,10280
|
|
11
|
+
qdrant_haystack-4.0.0.dist-info/RECORD,,
|
|
File without changes
|