langgenius / dify

Dify is an open-source LLM app development platform. Dify's intuitive interface combines AI workflow, RAG pipeline, agent capabilities, model management, observability features and more, letting you quickly go from prototype to production.
https://dify.ai
Other
53.37k stars 7.8k forks source link

Anthropic: At least one of the image dimensions exceeds max allowed size for many-images requests: 2000 pixels #11177

Open Yusaney opened 4 days ago

Yusaney commented 4 days ago

Self Checks

Dify version

0.11.0

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

I'm using Claude 3.5 with official Dify Anthropic integration. Not always, but in some cases I need to send multiple images for vision reading. And sometimes, I get this error: "messages.38.content.1.image.source.base64.data: At least one of the image dimensions exceeds max allowed size for many-images requests: 2000 pixels"

I couldn't find anything in Anthropic documentation with a max of 2000 pixels limits.

Also, I've tried sending the EXACT same request that fails every time using Anthropic integration; instead, it was sent to Claude 3.5 using OpenRouter and works perfectly.

✔️ Expected Behavior

It should work when you send +2000 px images

❌ Actual Behavior

It doesn't work if you send multiple images, and one of them is +2000 px

dosubot[bot] commented 4 days ago

Hey @Yusaney! 👋 I'm here to help you troubleshoot issues, answer questions, and even guide you on contributing. Let's tackle this bug together!

The error message you're encountering indicates that there is a limit on the image dimensions for many-images requests, specifically a maximum of 2000 pixels. This limit seems to be enforced within the Dify platform when using the Anthropic integration, but not when using OpenRouter.

Unfortunately, I couldn't find specific documentation or configuration settings in the Dify repository that explain or allow changing this 2000 pixels limit. It might be a hardcoded constraint within the Dify integration with Anthropic.

If this limit is causing issues, you might consider resizing the images to fit within the 2000 pixels constraint before sending them through the Anthropic integration. Alternatively, if OpenRouter does not impose this limit, you could continue using it for requests that involve larger images.

To continue talking to Dosu, mention @dosu.