Claude in Vertex AI does not support GCS or URL-based file ingestion via ADK
There appears to be an issue with file processing when using Claude models through the Google ADK, both with the LiteLLM backend and directly via the Vertex AI SDK. While the Gemini model can successfully process a PDF file from a Google Cloud Storage (GCS) URI, the same operation fails with Claude models.
Test Cases and Findings Here's a summary of the three test cases that were performed: Case 1: Gemini Model via Google ADK (Working) :
- Model: Gemini
- File: A PDF file stored in Google Cloud Storage (gs://...).
messages = { "parts": [ { "fileData": { "fileUri": "gs://file.pdf", "mime_type": mime_type } }, { "text": "summarise the attached file" } ], "role": "user" }
Behavior: The model successfully processed the file and returned an accurate summary of its contents. No errors were encountered.
Case 2: LiteLLM Claude Model via Google ADK (Not Working)
- Model: Claude (Vertex AI) invoked via the Google ADK using the LiteLLM backend.
- File: The same GCS PDF file as in Case 1. messages = { "parts": [ { "fileData": { "fileUri": "gs://file.pdf", "mime_type": mime_type } }, { "text": "summarise the attached file" } ], "role": "user" }
- Behavior: The request fails before it even reaches the Claude API.
- Error Message: LiteLlm(BaseLlm) does not support this content part.
Case 3: Claude Model via Vertex AI SDK (Not Working) Model: Claude on Vertex AI, invoked directly through the AnthropicVertex SDK.
-
File: A PDF provided via a public HTTPS URL.
-
Behavior: The Claude API rejects file sources that are URL-based. { "role": "user", "content": [ { "type": "document", "source": { "type": "url", "url": "https://assets.anthropic.com/m/1cd9d098ac3e6467/original/Claude-3-Model-Card-October-Addendum.pdf" } }, { "type": "text", "text": "What are the key findings in this document?" } ] }
-
Error Message: BadRequestError: URL sources are not supported
Expected Behavior The Claude models, when invoked through the Google ADK or Vertex AI SDK, should be able to process files from GCS URIs or public URLs, similar to the functionality observed with the Gemini model. This would allow for a consistent experience across different models available on the Vertex AI platform.
Actual Behavior Currently, any attempt to process files with Claude models through the tested methods fails: LiteLLM via ADK: Fails at the ADK level due to a lack of support for the fileData content part. Vertex AI SDK: Fails at the API level due to a lack of support for URL-based file sources.
Google ADK version: 1.8.0
Vertex AI region: us-east5
Claude model version: claude-sonnet-4@20250514
@gaya510 This issue is still present in ADK 1.19.0.
The root cause is in anthropic_llm.py:151 where part_to_message_block() raises NotImplementedError for file_data parts - only inline_data images are supported.
Additionally, Claude's API doesn't support URL sources upstream, so any fix would need to download GCS files and convert to base64 inline format.
Workaround: manually download files from GCS and send as inline_data with base64-encoded content instead of using file_data parts.
Thanks!
@ankursharmas Please have a look into it.
This issue remains unresolved in ADK 1.20.0.
Testing confirms anthropic_llm.py:151 still raises NotImplementedError for file_data parts.
Claude's API limitation (no URL sources) persists upstream, requiring any ADK fix to download GCS files and convert to base64.
The workaround remains: manually download files and send as inline_data with base64-encoded content.
Checked against latest ADK (post v1.23.0) — this bug is still present.
anthropic_llm.py:152 still raises NotImplementedError for file_data parts (GCS URIs, URLs).
The LiteLLM path (commit 85ed5008) added a text fallback that converts file_data to a [File reference: "filename"] placeholder instead of crashing, but does NOT send actual file content to Claude.
No GCS download + base64 conversion logic has been added, and Claude's API still doesn't support URL sources upstream.
Workaround remains: manually download files and send as inline_data with base64-encoded content.
Does a fix need to happen in this library, or is this a fundamental limitation of the anthropic vertex deployments? if the latter, is there a different repo we should raise this as a feature request?
Posting before the PR, per CONTRIBUTING.
I reproduced this on main at 25d19171: a file_data part with file_uri='gs://my-bucket/reports/q4.pdf' and mime_type='application/pdf' reaches _part_to_message_block (src/google/adk/models/anthropic_llm.py) and raises NotImplementedError: Not supported yet, while Gemini handles the same part. The function has branches for inline images and PDFs but none for file_data.
I have a fix ready that follows the direction given above: download the gs:// object and send it as an inline base64 document or image block. google.cloud.storage is imported lazily inside the helper (same pattern as gcs_artifact_service.py), and the download is capped at Anthropic's 32 MB document limit, checked against the blob size before the download starts. Other URI schemes and MIME types keep the current NotImplementedError. Four tests cover the PDF path, the size cap, an unsupported type and the missing-extra error. tests/unittests/models: 1771 passed. PR follows now.