Skip to content

Commit 7ad4906

Browse files
committed
Fixes error when stop reason missing in response.
1 parent 9adc14d commit 7ad4906

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libs/aws/langchain_aws/llms/bedrock.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ def prepare_output(cls, provider: str, response: Any) -> dict:
257257
"completion_tokens": completion_tokens,
258258
"total_tokens": prompt_tokens + completion_tokens,
259259
},
260-
"stop_reason": response_body["stop_reason"],
260+
"stop_reason": response_body.get("stop_reason"),
261261
}
262262

263263
@classmethod

0 commit comments

Comments
 (0)