I occasionally get a the following error on completions:
KeyError: 'message'
Here's the stack:
File ".../langchain_aws/chat_models/bedrock.py", line 361, in _generate
for chunk in self._stream(messages, stop, run_manager, **kwargs):
File ".../langchain_aws/chat_models/bedrock.py", line 339, in _stream
for chunk in self._prepare_input_and_invoke_stream(
File ".../langchain_aws/llms/bedrock.py", line 653, in _prepare_input_and_invoke_stream
for chunk in LLMInputOutputAdapter.prepare_output_stream(
File ".../langchain_aws/llms/bedrock.py", line 239, in prepare_output_stream
chunk_obj[output_key]
I occasionally get a the following error on completions:
KeyError: 'message'
Here's the stack:
Here are my langchain versions:
Python version: Python 3.11.6 Model Id: anthropic.claude-3-sonnet-20240229-v1:0
The error is intermittent. It appears to be an issue with the response that Bedrock is generating.