-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Description
I have created an agent that is configured with the SaveFilesAsArtifactsPlugin. I intentionally did not configure the load_artifact tool to ensure that the agent cannot use it to load any artifacts. I also configured the GcsArtifactService.
When I upload a file, I can see in the conversation history that everything appears as expected. For example:
file_data:
display_name: "The_One_Ring_Core_Rules_2401.pdf"
file_uri: "gs://gma-bucket/game_master_agent/user/668335cc-e984-42ad-8d2f-81df5ad24778/The_One_Ring_Core_Rules_2401.pdf/0"
mime_type: "application/pdf"
However, after the artifact was processed, I noticed a significant delay in each subsequent response from the LLM. From the logs, I found that the input token usage looked like this:
Token Usage - Input: 97424, Output: 29
I’m not sure how to interpret that, but it seems that the file’s payload ended up in the context.
To Reproduce
Please share a minimal code and data to reproduce your problem.
Steps to reproduce the behavior:
- Install 'google-adk and create a basic agent with the SaveFilesAsArtifactsPlugin and the GcsArtifactService configured'
- Run 'uv run adk web . --port 8000 --reload_agents --artifact_service_uri "gs://bucket"'
- Upload a file and then ask anything else
Expected behavior
The input token usage should be close to the size of your question.
Screenshots
Desktop (please complete the following information):
- OS: Linux
- Python version: 3.12.7
- ADK version: 1.19.0
Model Information:
- Are you using LiteLLM: No
- Which model is being used: gemini-2.5-flash