google / google/adk-python

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

Aperta
#2,466 5 commenti 5 reazioni 3 assegnatari Assegnata a @ankursharmas Vedi su GitHub
models needs review
Lingua principale
Python
Stelle
21.5k
Fork
4k
Merge medio
1g 14h
PR unite (30g)
37

Descrizione

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

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.