From 993d99e0a645d67c5a1813218224c483406ca518 Mon Sep 17 00:00:00 2001 From: HaystackBot Date: Mon, 5 Aug 2024 18:16:57 +0000 Subject: [PATCH 1/2] Update the changelog --- integrations/amazon_sagemaker/CHANGELOG.md | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 integrations/amazon_sagemaker/CHANGELOG.md diff --git a/integrations/amazon_sagemaker/CHANGELOG.md b/integrations/amazon_sagemaker/CHANGELOG.md new file mode 100644 index 000000000..edd15fc82 --- /dev/null +++ b/integrations/amazon_sagemaker/CHANGELOG.md @@ -0,0 +1,27 @@ +# Changelog + +## [unreleased] + +### 🚀 Features + +- Sagemaker integration: `SagemakerGenerator` (#276) + +### 🐛 Bug Fixes + +- Fix order of API docs (#447) + +This PR will also push the docs to Readme + +### 📚 Documentation + +- Update category slug (#442) +- Small consistency improvements (#536) +- Review integrations sagemaker (#544) +- Disable-class-def (#556) + +### ⚙️ Miscellaneous Tasks + +- Retry tests to reduce flakyness (#836) +- Update ruff invocation to include check parameter (#853) + + From 5be0bf74d2836b81cc60de84d9f8a1541ec7e191 Mon Sep 17 00:00:00 2001 From: Agnieszka Marzec <97166305+agnieszka-m@users.noreply.github.com> Date: Mon, 5 Aug 2024 22:01:52 +0200 Subject: [PATCH 2/2] Update docstrings (#947) --- .../opensearch/embedding_retriever.py | 39 +++++++++++-------- 1 file changed, 23 insertions(+), 16 deletions(-) diff --git a/integrations/opensearch/src/haystack_integrations/components/retrievers/opensearch/embedding_retriever.py b/integrations/opensearch/src/haystack_integrations/components/retrievers/opensearch/embedding_retriever.py index eba5596f2..cdf905b97 100644 --- a/integrations/opensearch/src/haystack_integrations/components/retrievers/opensearch/embedding_retriever.py +++ b/integrations/opensearch/src/haystack_integrations/components/retrievers/opensearch/embedding_retriever.py @@ -16,9 +16,9 @@ @component class OpenSearchEmbeddingRetriever: """ - Uses a vector similarity metric to retrieve documents from the OpenSearchDocumentStore. + Retrieves documents from the OpenSearchDocumentStore using a vector similarity metric. - Needs to be connected to the OpenSearchDocumentStore to run. + Must be connected to the OpenSearchDocumentStore to run. """ def __init__( @@ -34,12 +34,16 @@ def __init__( """ Create the OpenSearchEmbeddingRetriever component. - :param document_store: An instance of OpenSearchDocumentStore. - :param filters: Filters applied to the retrieved Documents. Defaults to None. - Filters are applied during the approximate kNN search to ensure that top_k matching documents are returned. - :param top_k: Maximum number of Documents to return, defaults to 10 - :param filter_policy: Policy to determine how filters are applied. - :param custom_query: The query containing a mandatory `$query_embedding` and an optional `$filters` placeholder + :param document_store: An instance of OpenSearchDocumentStore to use with the Retriever. + :param filters: Filters applied when fetching documents from the Document Store. + Filters are applied during the approximate kNN search to ensure the Retriever returns + `top_k` matching documents. + :param top_k: Maximum number of documents to return. + :param filter_policy: Policy to determine how filters are applied. Possible options: + - `merge`: Runtime filters are merged with initialization filters. + - `replace`: Runtime filters replace initialization filters. Use this policy to change the filtering scope. + :param custom_query: The custom OpenSearch query containing a mandatory `$query_embedding` and + an optional `$filters` placeholder. **An example custom_query:** @@ -63,14 +67,15 @@ def __init__( } ``` - **For this custom_query, a sample `run()` could be:** + For this `custom_query`, an example `run()` could be: ```python retriever.run(query_embedding=embedding, filters={"years": ["2019"], "quarters": ["Q1", "Q2"]}) ``` :param raise_on_failure: - Whether to raise an exception if the API call fails. Otherwise log a warning and return an empty list. + If `True`, raises an exception if the API call fails. + If `False`, logs a warning and returns an empty list. :raises ValueError: If `document_store` is not an instance of OpenSearchDocumentStore. """ @@ -137,11 +142,13 @@ def run( Retrieve documents using a vector similarity metric. :param query_embedding: Embedding of the query. - :param filters: Filters applied to the retrieved Documents. The way runtime filters are applied depends on - the `filter_policy` chosen at retriever initialization. See init method docstring for more - details. - :param top_k: Maximum number of Documents to return. - :param custom_query: The query containing a mandatory `$query_embedding` and an optional `$filters` placeholder + :param filters: Filters applied when fetching documents from the Document Store. + Filters are applied during the approximate kNN search to ensure the Retriever + returns `top_k` matching documents. + The way runtime filters are applied depends on the `filter_policy` selected when initializing the Retriever. + :param top_k: Maximum number of documents to return. + :param custom_query: A custom OpenSearch query containing a mandatory `$query_embedding` and an + optional `$filters` placeholder. **An example custom_query:** @@ -165,7 +172,7 @@ def run( } ``` - **For this custom_query, a sample `run()` could be:** + For this `custom_query`, an example `run()` could be: ```python retriever.run(query_embedding=embedding,