mirror of
https://github.com/hwchase17/langchain.git
synced 2025-08-11 05:45:01 +00:00
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:
parent
7ffc431b3a
commit
490f4a9ff0
@ -207,7 +207,7 @@ class AmazonKendraRetriever(BaseRetriever):
|
|||||||
|
|
||||||
@root_validator(pre=True)
|
@root_validator(pre=True)
|
||||||
def create_client(cls, values: Dict[str, Any]) -> Dict[str, Any]:
|
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
|
return values
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
Loading…
Reference in New Issue
Block a user