The agent engineering platform.
Python agentsaiai-agentsanthropicchatgptdeepagentsenterpriseframeworkgeminigenerative-ailangchainlanggraphllmmultiagentopen-sourceopenaipydanticpythonragtypescript
community: add Kendra DocumentRelevanceOverrideConfigurations request parameter (#20695)
scaserinia6cdf6572fa4
diff --git a/libs/community/langchain_community/retrievers/kendra.py b/libs/community/langchain_community/retrievers/kendra.pyindex a84f38a292..c4479e450a 100644--- a/libs/community/langchain_community/retrievers/kendra.py+++ b/libs/community/langchain_community/retrievers/kendra.py@@ -344,6 +344,10 @@ class AmazonKendraRetriever(BaseRetriever):attribute_filter: Additional filtering of results based on metadataSee: https://docs.aws.amazon.com/kendra/latest/APIReference+ document_relevance_override_configurations: Overrides relevance tuning+ configurations of fields/attributes set at the index level+ See: https://docs.aws.amazon.com/kendra/latest/APIReference+page_content_formatter: generates the Document page_contentallowing access to all result item attributes. By default, it usesthe item's title and excerpt.@@ -367,6 +371,7 @@ class AmazonKendraRetriever(BaseRetriever):credentials_profile_name: Optional[str] = Nonetop_k: int = 3attribute_filter: Optional[Dict] = None+ document_relevance_override_configurations: Optional[List[Dict]] = Nonepage_content_formatter: Callable[[ResultItem], str] = combined_textclient: Anyuser_context: Optional[Dict] = None@@ -421,6 +426,10 @@ class AmazonKendraRetriever(BaseRetriever):}if self.attribute_filter is not None:kendra_kwargs["AttributeFilter"] = self.attribute_filter+ if self.document_relevance_override_configurations is not None:+ kendra_kwargs[+ "DocumentRelevanceOverrideConfigurations"+ ] = self.document_relevance_override_configurationsif self.user_context is not None:kendra_kwargs["UserContext"] = self.user_context