Skip to content

Anthropic LLM adapter does not support PDF document uploads #4728

@encounter

Description

@encounter

Is this a Bug or a Feature Request?

Feature Request

Description

The Anthropic LLM adapter (AnthropicLlm / Claude) does not support PDF document uploads. When a types.Part with inline_data containing application/pdf MIME type is sent through the adapter, it raises NotImplementedError because part_to_message_block() has no handler for document parts.

The Anthropic API supports PDF documents via DocumentBlockParam with base64-encoded data, and the ADK's LiteLLM adapter already handles document MIME types, but the native Anthropic adapter does not.

Expected Behavior

PDF document parts should be converted to Anthropic's DocumentBlockParam format and sent to the API, following the same pattern already used for image parts (_is_image_part / ImageBlockParam).

Steps to Reproduce

  1. Create an agent using AnthropicLlm or Claude as the LLM
  2. Send a message containing a PDF document as a types.Part with inline_data (mime_type application/pdf)
  3. The adapter raises NotImplementedError

Additional Context

The image part handling pattern is already well-established in anthropic_llm.py and can be extended to documents with minimal changes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    models[Component] Issues related to model support

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions