Skip to content

SaveFilesAsArtifactsPlugin: Can't handle too big files (PDFs) #3751

@Smponias

Description

@Smponias

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

Metadata

Metadata

Assignees

Labels

services[Component] This issue is related to runtime services, e.g. sessions, memory, artifacts, etc

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions