Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Qdrant - improve docstrings for retrievers #687

Merged
merged 1 commit into from
Apr 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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