Skip to content

Commit

Permalink
qdrant - improve docstrings for retrievers (#687)
Browse files Browse the repository at this point in the history
  • Loading branch information
anakin87 authored Apr 26, 2024
1 parent 9ed3230 commit 1790fc5
Showing 1 changed file with 13 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class QdrantEmbeddingRetriever:
Usage example:
```python
from haystack.dataclasses import Document
from haystack_integrations.components.retrievers.qdrant import QdrantEmbeddingRetriever
from haystack_integrations.document_stores.qdrant import QdrantDocumentStore
Expand Down Expand Up @@ -42,12 +43,12 @@ def __init__(
Create a QdrantEmbeddingRetriever component.
:param document_store: An instance of QdrantDocumentStore.
:param filters: A dictionary with filters to narrow down the search space. Default is None.
:param top_k: The maximum number of documents to retrieve. Default is 10.
:param scale_score: Whether to scale the scores of the retrieved documents or not. Default is True.
:param return_embedding: Whether to return the embedding of the retrieved Documents. Default is False.
:param filters: A dictionary with filters to narrow down the search space.
:param top_k: The maximum number of documents to retrieve.
:param scale_score: Whether to scale the scores of the retrieved documents or not.
:param return_embedding: Whether to return the embedding of the retrieved Documents.
:raises ValueError: If 'document_store' is not an instance of QdrantDocumentStore.
:raises ValueError: If `document_store` is not an instance of `QdrantDocumentStore`.
"""

if not isinstance(document_store, QdrantDocumentStore):
Expand Down Expand Up @@ -134,7 +135,7 @@ class QdrantSparseEmbeddingRetriever:
```python
from haystack_integrations.components.retrievers.qdrant import QdrantSparseEmbeddingRetriever
from haystack_integrations.document_stores.qdrant import QdrantDocumentStore
from haystack.dataclasses.sparse_embedding import SparseEmbedding
from haystack.dataclasses import Document, SparseEmbedding
document_store = QdrantDocumentStore(
":memory:",
Expand Down Expand Up @@ -164,12 +165,12 @@ def __init__(
Create a QdrantSparseEmbeddingRetriever component.
:param document_store: An instance of QdrantDocumentStore.
:param filters: A dictionary with filters to narrow down the search space. Default is None.
:param top_k: The maximum number of documents to retrieve. Default is 10.
:param scale_score: Whether to scale the scores of the retrieved documents or not. Default is True.
:param return_embedding: Whether to return the sparse embedding of the retrieved Documents. Default is False.
:param filters: A dictionary with filters to narrow down the search space.
:param top_k: The maximum number of documents to retrieve.
:param scale_score: Whether to scale the scores of the retrieved documents or not.
:param return_embedding: Whether to return the sparse embedding of the retrieved Documents.
:raises ValueError: If 'document_store' is not an instance of QdrantDocumentStore.
:raises ValueError: If `document_store` is not an instance of `QdrantDocumentStore`.
"""

if not isinstance(document_store, QdrantDocumentStore):
Expand Down Expand Up @@ -257,7 +258,7 @@ class QdrantHybridRetriever:
```python
from haystack_integrations.components.retrievers.qdrant import QdrantHybridRetriever
from haystack_integrations.document_stores.qdrant import QdrantDocumentStore
from haystack.dataclasses.sparse_embedding import SparseEmbedding
from haystack.dataclasses import Document, SparseEmbedding
document_store = QdrantDocumentStore(
":memory:",
Expand Down

0 comments on commit 1790fc5

Please sign in to comment.