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
This commit is contained in:
Ronald Li 2023-07-10 15:02:36 +08:00 committed by GitHub
parent 7ffc431b3a
commit 490f4a9ff0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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: