Open bdavj opened 1 week ago
Thanks for reaching out. Here is the converse_stream documentation for reference. The command is calling the Bedrock ConverseStream API, and it looks like the issue here is with the API validation. I'm not sure why the behavior isn't consistent with the console.
Can you provide a complete code snippet for reproducing the issue? You mentioned using ChatBedrock, so I'm also wondering if the issue could be with the third-party integration. If you want to share debug logs as well (with any sensitive info redacted) by adding boto3.set_stream_logger('')
to your script then that could also help provide more insight here.
Describe the bug
Using a 2.5mb PDF, and a 300kb image, same result with both.
On the playground, both upload OK and can converse effectively around the documents.
On the API, I get the following response:
botocore.exceptions.EventStreamError: An error occurred (validationException) when calling the ConverseStream operation: The model returned the following errors: Input is too long for requested model.
This is using ChatBedrock, and the message section formatted as either:
{"image": {"format": get_file_format(file_obj), "source": {"base64": base64.b64encode(binary_data).decode('utf-8')}}}
orThis has also been tried using the raw binary data as bytes in the source.
Regression Issue
Expected Behavior
To be able to converse as per the playground on enclosing an image / document
Current Behavior
botocore.exceptions.EventStreamError: An error occurred (validationException) when calling the ConverseStream operation: The model returned the following errors: Input is too long for requested model.
Reproduction Steps