Thanks to visit codestin.com
Credit goes to github.com

Skip to content

litellm BadRequestError while processing images and PDFs. #2017

@srochiramani

Description

@srochiramani

Describe the bug

  • LLMs (tested with Anthropic) are erroring out while being provided images or files (pdfs) in v1.7. I tested the same code in v1.6.1 and it works perfectly for images (note pdf support was added in v1.7).

To Reproduce

  • Try to load an artifact in v1.7 that's an image (png/jpeg etc).

Expected behavior

  • LLM responds processing that image context

Screenshots
Exception:
litellm.exceptions.BadRequestError: litellm.BadRequestError: AnthropicException - {"type":"error","error":{"type":"invalid_request_error","message":"messages.4.content.2.image.source.base64.media_type: Input should be 'image/jpeg', 'image/png', 'image/gif' or 'image/webp'"}}

Desktop (please complete the following information):

  • ADK Version 1.7 (works fine in v1.6.1)

Model Information:

  • Claude 4.0 Sonnet

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

Labels

bot triaged[Bot] This issue is triaged by ADK botmodels[Component] Issues related to model support

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions