Skip to content

[Bug]: PDF as input type is not working for anthropic models via bedrock converse #20426

@tanvithakur94

Description

@tanvithakur94

Check for existing issues

  • I have searched the existing issues and checked that my issue is not a duplicate.

What happened?

As per the docs: https://docs.litellm.ai/docs/completion/document_understanding, this payload should work:
https://docs.litellm.ai/docs/completion/document_understanding#base64

However, when we are trying to test out the same:

{
  "messages": [
    {
      "role": "user",
      "content": [
        {
          "type": "file",
          "file": {
            // "file_id": "draconomicon.pdf",
            "file_data": "data:application/pdf;base64,JVBERi0xLjQKJf////amGUlRU9GCg=="
          }
        }
      ]
       }
  ]
}

I get error litellm.exceptions.BadRequestError: litellm.BadRequestError: BedrockException - {}

Steps to Reproduce

Shared above

Relevant log output

What part of LiteLLM is this about?

SDK (litellm Python package)

What LiteLLM version are you on ?

v1.80.10, v1.81.7

Twitter / LinkedIn details

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions