Skip to content

Commit 1790fc5

Browse files
authored
qdrant - improve docstrings for retrievers (#687)
1 parent 9ed3230 commit 1790fc5

File tree

1 file changed

+13
-12
lines changed
  • integrations/qdrant/src/haystack_integrations/components/retrievers/qdrant

1 file changed

+13
-12
lines changed

integrations/qdrant/src/haystack_integrations/components/retrievers/qdrant/retriever.py

+13-12
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ class QdrantEmbeddingRetriever:
1212
1313
Usage example:
1414
```python
15+
from haystack.dataclasses import Document
1516
from haystack_integrations.components.retrievers.qdrant import QdrantEmbeddingRetriever
1617
from haystack_integrations.document_stores.qdrant import QdrantDocumentStore
1718
@@ -42,12 +43,12 @@ def __init__(
4243
Create a QdrantEmbeddingRetriever component.
4344
4445
:param document_store: An instance of QdrantDocumentStore.
45-
:param filters: A dictionary with filters to narrow down the search space. Default is None.
46-
:param top_k: The maximum number of documents to retrieve. Default is 10.
47-
:param scale_score: Whether to scale the scores of the retrieved documents or not. Default is True.
48-
:param return_embedding: Whether to return the embedding of the retrieved Documents. Default is False.
46+
:param filters: A dictionary with filters to narrow down the search space.
47+
:param top_k: The maximum number of documents to retrieve.
48+
:param scale_score: Whether to scale the scores of the retrieved documents or not.
49+
:param return_embedding: Whether to return the embedding of the retrieved Documents.
4950
50-
:raises ValueError: If 'document_store' is not an instance of QdrantDocumentStore.
51+
:raises ValueError: If `document_store` is not an instance of `QdrantDocumentStore`.
5152
"""
5253

5354
if not isinstance(document_store, QdrantDocumentStore):
@@ -134,7 +135,7 @@ class QdrantSparseEmbeddingRetriever:
134135
```python
135136
from haystack_integrations.components.retrievers.qdrant import QdrantSparseEmbeddingRetriever
136137
from haystack_integrations.document_stores.qdrant import QdrantDocumentStore
137-
from haystack.dataclasses.sparse_embedding import SparseEmbedding
138+
from haystack.dataclasses import Document, SparseEmbedding
138139
139140
document_store = QdrantDocumentStore(
140141
":memory:",
@@ -164,12 +165,12 @@ def __init__(
164165
Create a QdrantSparseEmbeddingRetriever component.
165166
166167
:param document_store: An instance of QdrantDocumentStore.
167-
:param filters: A dictionary with filters to narrow down the search space. Default is None.
168-
:param top_k: The maximum number of documents to retrieve. Default is 10.
169-
:param scale_score: Whether to scale the scores of the retrieved documents or not. Default is True.
170-
:param return_embedding: Whether to return the sparse embedding of the retrieved Documents. Default is False.
168+
:param filters: A dictionary with filters to narrow down the search space.
169+
:param top_k: The maximum number of documents to retrieve.
170+
:param scale_score: Whether to scale the scores of the retrieved documents or not.
171+
:param return_embedding: Whether to return the sparse embedding of the retrieved Documents.
171172
172-
:raises ValueError: If 'document_store' is not an instance of QdrantDocumentStore.
173+
:raises ValueError: If `document_store` is not an instance of `QdrantDocumentStore`.
173174
"""
174175

175176
if not isinstance(document_store, QdrantDocumentStore):
@@ -257,7 +258,7 @@ class QdrantHybridRetriever:
257258
```python
258259
from haystack_integrations.components.retrievers.qdrant import QdrantHybridRetriever
259260
from haystack_integrations.document_stores.qdrant import QdrantDocumentStore
260-
from haystack.dataclasses.sparse_embedding import SparseEmbedding
261+
from haystack.dataclasses import Document, SparseEmbedding
261262
262263
document_store = QdrantDocumentStore(
263264
":memory:",

0 commit comments

Comments
 (0)