Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Claude 3.5 V2 Sonnet doesn't support file attachments on the API, works in playground #4341

Closed
1 task
bdavj opened this issue Nov 11, 2024 · 2 comments
Closed
1 task
Assignees
Labels
bug This issue is a confirmed bug. closed-for-staleness p2 This is a standard priority issue response-requested Waiting on additional information or feedback. service-api This issue is caused by the service API, not the SDK implementation.

Comments

@bdavj
Copy link

bdavj commented Nov 11, 2024

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')}}} or

{
                            "document": {
                                "name": sanitize_filename(file_obj.name),
                                "format": get_file_format(file_obj),
                                "source": {
                                    "base64": base64.b64encode(binary_data).decode('utf-8')
                                },
                            }
                        }

This has also been tried using the raw binary data as bytes in the source.

Regression Issue

  • Select this option if this issue appears to be a regression.

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

Possible Solution

No response

Additional Information/Context

No response

SDK version used

1.35.57

Environment details (OS name and version, etc.)

Mac OS Sonoma, Python 3.12.5

@bdavj bdavj added bug This issue is a confirmed bug. needs-triage This issue or PR still needs to be triaged. labels Nov 11, 2024
@tim-finnigan tim-finnigan self-assigned this Nov 11, 2024
@tim-finnigan
Copy link
Contributor

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.

@tim-finnigan tim-finnigan added response-requested Waiting on additional information or feedback. service-api This issue is caused by the service API, not the SDK implementation. p2 This is a standard priority issue and removed needs-triage This issue or PR still needs to be triaged. labels Nov 11, 2024
Copy link

Greetings! It looks like this issue hasn’t been active in longer than five days. We encourage you to check if this is still an issue in the latest release. In the absence of more information, we will be closing this issue soon. If you find that this is still a problem, please feel free to provide a comment or upvote with a reaction on the initial post to prevent automatic closure. If the issue is already closed, please feel free to open a new one.

@github-actions github-actions bot added closing-soon This issue will automatically close in 4 days unless further comments are made. closed-for-staleness and removed closing-soon This issue will automatically close in 4 days unless further comments are made. labels Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a confirmed bug. closed-for-staleness p2 This is a standard priority issue response-requested Waiting on additional information or feedback. service-api This issue is caused by the service API, not the SDK implementation.
Projects
None yet
Development

No branches or pull requests

2 participants