google / google/adk-python

Claude in Vertex AI does not support GCS or URL-based file ingestion via ADK

Offen
#2,466 5 Kommentare 5 Reaktionen 3 zugewiesene Personen Zugewiesen an @ankursharmas Auf GitHub ansehen
models needs review
Vorherrschende Sprache
Python
Sterne
21.5k
Forks
4k
Ø Merge
1 T. 14 Std.
Gemergte PRs (30 T.)
37

Beschreibung

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.

Image

**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

Image

**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

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.