adk-python
adk-python copied to clipboard
SaveFilesAsArtifactsPlugin: Can't handle too big files (PDFs)
Describe the bug
Using SaveFilesAsArtifactsPlugin works fine until the file gets too big.
Uploading a PDF with around 5MB - ✅
Uploading a PDF with around 50MB - ❌
Error: 400 INVALID_ARGUMENT. {'error': {'code': 400, 'message': 'Request contains an invalid argument.', 'status': 'INVALID_ARGUMENT'}}
To Reproduce Run this code
root_agent = Agent(
name="Super Cool Agent",
model="gemini-2.5-flash",
description="Analyzing the uploaded PDF",
instruction="Analyze the uploaded PDF and give the user a short summary",
)
app = App(
name='Super_Cool_Agent',
root_agent=root_agent,
plugins=[SaveFilesAsArtifactsPlugin()],
)
Expected behavior I should be able to upload all files or get a proper error message.
Desktop (please complete the following information):
- OS: macOS
- Python version(python -V): 3.14
- ADK version(pip show google-adk): 1.19.0
Model Information:
- Are you using LiteLLM: No
- Which model is being used(e.g. gemini-2.5-pro): gemini-2.5-flash