Skip to content

Bedrock Sonnet API document limit

0

When using the API for Sonnet 3.5 or 3.7, when using the computer action, it uploads a photo of the action to confirm with the model and interpret. However after some time, it will throw the error "too many images and documents: 21 + 0 > 20" and I have to start a new task because I can't continue.

Is this account limit specific or global?

1 Answer
0

The error you're encountering is related to the limitations of the Bedrock Claude Sonnet API, and it's not account-specific but rather a global limitation of the service.

For the Bedrock Claude Sonnet API (which applies to both 3.5 and 3.7 versions), there is a limit on the number of images that can be included in a single conversation or task. Specifically, you can include up to 20 images in a message. This limit is part of the API's design to manage resource usage and maintain performance.

When you're using the computer action feature that uploads photos to confirm and interpret actions, these images are accumulating in your conversation. Once you reach the limit of 20 images, the API throws the error you've encountered: "too many images and documents: 21 + 0 > 20".

This limitation means that for long-running tasks or conversations that involve many image uploads, you'll need to start a new task or conversation after reaching the 20-image limit. This is a constraint of the API itself and not something that can be adjusted on a per-account basis.

To work around this limitation, you might consider:

  1. Breaking your task into smaller segments that don't exceed the 20-image limit.
  2. Implementing a system to start a new conversation automatically when approaching the limit.
  3. Exploring if there are ways to reduce the number of image uploads needed for your specific use case.

Remember that these limits are in place to ensure the service's stability and performance for all users. If this limitation significantly impacts your workflow, you may want to reach out to AWS support to discuss your specific use case and explore potential alternatives or solutions.
Sources
Message - Amazon Bedrock

answered 2 years ago

EXPERT

reviewed 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.