Skip to content

Commit

Permalink
Fixes error when stop reason missing in response.
Browse files Browse the repository at this point in the history
  • Loading branch information
3coins committed May 23, 2024
1 parent 9adc14d commit 7ad4906
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libs/aws/langchain_aws/llms/bedrock.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ def prepare_output(cls, provider: str, response: Any) -> dict:
"completion_tokens": completion_tokens,
"total_tokens": prompt_tokens + completion_tokens,
},
"stop_reason": response_body["stop_reason"],
"stop_reason": response_body.get("stop_reason"),
}

@classmethod
Expand Down

0 comments on commit 7ad4906

Please sign in to comment.