Fixes KeyError in AmazonKendraRetriever initializer (#7464)

### Description
argument variable client is marked as required in commit
81e5b1ad36 which breaks the default way of
initialization providing only index_id. This commit avoid KeyError
exception when it is initialized without a client variable
### Dependencies
no dependency required
pull/7356/head
Ronald Li 1 year ago committed by GitHub
parent 7ffc431b3a
commit 490f4a9ff0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -207,7 +207,7 @@ class AmazonKendraRetriever(BaseRetriever):
@root_validator(pre=True)
def create_client(cls, values: Dict[str, Any]) -> Dict[str, Any]:
if values["client"] is not None:
if values.get("client") is not None:
return values
try:

Loading…
Cancel
Save