Skip to content

Commit c9e8399

Browse files
committed
docs: use single backticks for inline code in docstrings
Matches the repo convention used across other integrations.
1 parent 8564008 commit c9e8399

2 files changed

Lines changed: 19 additions & 19 deletions

File tree

integrations/amazon_s3_vectors/src/haystack_integrations/components/retrievers/amazon_s3_vectors/embedding_retriever.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
@component
1616
class S3VectorsEmbeddingRetriever:
1717
"""
18-
Retrieve documents from an ``S3VectorsDocumentStore`` based on their dense embeddings.
18+
Retrieve documents from an `S3VectorsDocumentStore` based on their dense embeddings.
1919
2020
Usage example:
2121
```python
@@ -64,11 +64,11 @@ def __init__(
6464
"""
6565
Initialize the S3VectorsEmbeddingRetriever.
6666
67-
:param document_store: An instance of ``S3VectorsDocumentStore``.
67+
:param document_store: An instance of `S3VectorsDocumentStore`.
6868
:param filters: Filters applied to the retrieved Documents.
6969
:param top_k: Maximum number of Documents to return.
7070
:param filter_policy: Policy to determine how filters are applied.
71-
:raises ValueError: If ``document_store`` is not an ``S3VectorsDocumentStore``.
71+
:raises ValueError: If `document_store` is not an `S3VectorsDocumentStore`.
7272
"""
7373
if not isinstance(document_store, S3VectorsDocumentStore):
7474
msg = "document_store must be an instance of S3VectorsDocumentStore"
@@ -113,10 +113,10 @@ def run(
113113
114114
:param query_embedding: Embedding of the query.
115115
:param filters: Filters applied to the retrieved Documents. The way runtime filters are applied depends on
116-
the ``filter_policy`` chosen at retriever initialization. Filters are applied server-side during
116+
the `filter_policy` chosen at retriever initialization. Filters are applied server-side during
117117
the vector search.
118118
:param top_k: Maximum number of Documents to return. S3 Vectors caps this at 100.
119-
:returns: A dictionary with key ``"documents"`` containing the retrieved Documents.
119+
:returns: A dictionary with key `"documents"` containing the retrieved Documents.
120120
Returned documents will not contain embeddings.
121121
"""
122122
filters = apply_filter_policy(self.filter_policy, self.filters, filters)

integrations/amazon_s3_vectors/src/haystack_integrations/document_stores/amazon_s3_vectors/document_store.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,12 @@ class S3VectorsDocumentStore:
5656
5757
**Service limits:**
5858
59-
- Maximum ``top_k``: 100 results per query
59+
- Maximum `top_k`: 100 results per query
6060
- Maximum vector dimension: 4,096
6161
- Metadata per vector: 40 KB total, 2 KB filterable
62-
- All documents must have embeddings (``float32`` only)
63-
- Distance metrics: ``cosine`` or ``euclidean`` (set at index creation, immutable)
64-
- ``filter_documents()`` is client-side — prefer ``S3VectorsEmbeddingRetriever`` with filters
62+
- All documents must have embeddings (`float32` only)
63+
- Distance metrics: `cosine` or `euclidean` (set at index creation, immutable)
64+
- `filter_documents()` is client-side — prefer `S3VectorsEmbeddingRetriever` with filters
6565
6666
Usage example:
6767
```python
@@ -95,13 +95,13 @@ def __init__(
9595
:param vector_bucket_name: Name of the S3 vector bucket.
9696
:param index_name: Name of the vector index within the bucket.
9797
:param dimension: Dimensionality of the embeddings (e.g. 768, 1536).
98-
:param distance_metric: Distance metric for similarity search: ``"cosine"`` or ``"euclidean"``.
98+
:param distance_metric: Distance metric for similarity search: `"cosine"` or `"euclidean"`.
9999
:param region_name: AWS region. If not provided, uses the default from the environment/config.
100100
:param aws_access_key_id: AWS access key ID. If not provided, uses the default credential chain.
101101
:param aws_secret_access_key: AWS secret access key.
102102
:param aws_session_token: AWS session token for temporary credentials.
103103
:param create_bucket_and_index: Whether to automatically create the vector bucket and index
104-
if they do not exist. Defaults to ``True``.
104+
if they do not exist. Defaults to `True`.
105105
:param non_filterable_metadata_keys: Additional metadata keys to mark as non-filterable
106106
on the index (beyond the internal keys used for Document content/blob storage).
107107
"""
@@ -240,15 +240,15 @@ def write_documents(self, documents: list[Document], policy: DuplicatePolicy = D
240240
"""
241241
Write Documents to the S3 Vectors index.
242242
243-
All documents must have an embedding set. S3 Vectors ``put_vectors`` is an upsert operation
244-
by default, so ``DuplicatePolicy.OVERWRITE`` is the natural behavior.
245-
``DuplicatePolicy.SKIP`` will check for existing documents first (slower).
246-
``DuplicatePolicy.NONE`` will raise an error if a document already exists.
243+
All documents must have an embedding set. S3 Vectors `put_vectors` is an upsert operation
244+
by default, so `DuplicatePolicy.OVERWRITE` is the natural behavior.
245+
`DuplicatePolicy.SKIP` will check for existing documents first (slower).
246+
`DuplicatePolicy.NONE` will raise an error if a document already exists.
247247
248248
Metadata per vector is limited to 40 KB total (2 KB filterable).
249249
250250
:param documents: A list of Documents to write. Each document must have an embedding.
251-
:param policy: The duplicate policy. Defaults to ``DuplicatePolicy.OVERWRITE``.
251+
:param policy: The duplicate policy. Defaults to `DuplicatePolicy.OVERWRITE`.
252252
:returns: The number of documents written.
253253
"""
254254
if len(documents) == 0:
@@ -312,7 +312,7 @@ def filter_documents(self, filters: dict[str, Any] | None = None) -> list[Docume
312312
S3 Vectors only supports metadata filtering during vector similarity queries, not as a
313313
standalone operation. This method lists all vectors and applies filters client-side,
314314
which can be very slow for large indexes. For filtered retrieval, prefer using
315-
``S3VectorsEmbeddingRetriever`` with filters instead.
315+
`S3VectorsEmbeddingRetriever` with filters instead.
316316
317317
:param filters: Haystack-format filters to apply.
318318
:returns: A list of matching Documents.
@@ -383,13 +383,13 @@ def _embedding_retrieval(
383383
Retrieve documents most similar to the query embedding.
384384
385385
This method is not part of the public interface.
386-
Use ``S3VectorsEmbeddingRetriever`` instead.
386+
Use `S3VectorsEmbeddingRetriever` instead.
387387
388388
:param query_embedding: The query embedding vector.
389389
:param filters: Optional Haystack-format metadata filters.
390390
:param top_k: Maximum number of results to return. S3 Vectors caps this at 100.
391391
:returns: List of Documents sorted by similarity. Returned documents will not contain
392-
embeddings (S3 Vectors ``query_vectors`` does not return vector data).
392+
embeddings (S3 Vectors `query_vectors` does not return vector data).
393393
"""
394394
if not query_embedding:
395395
msg = "query_embedding must be a non-empty list of floats"

0 commit comments

Comments
 (0)