diff --git a/libs/community/langchain_community/retrievers/kendra.py b/libs/community/langchain_community/retrievers/kendra.py index ec1554c0abf8b..5254ef49bff1d 100644 --- a/libs/community/langchain_community/retrievers/kendra.py +++ b/libs/community/langchain_community/retrievers/kendra.py @@ -379,7 +379,7 @@ def create_client(cls, values: Dict[str, Any]) -> Dict[str, Any]: def _kendra_query(self, query: str) -> Sequence[ResultItem]: kendra_kwargs = { "IndexId": self.index_id, - "QueryText": query.strip(), + "QueryText": query.strip()[0:999], #trucate the query to ensure that there is no validation exception from Kendra. "PageSize": self.top_k, } if self.attribute_filter is not None: