-
Notifications
You must be signed in to change notification settings - Fork 3k
Description
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
- Create an agent using
AnthropicLlmorClaudeas the LLM - Send a message containing a PDF document as a
types.Partwithinline_data(mime_typeapplication/pdf) - 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.