-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Description
Hi, I have recently added caching to my agents by wrapping them as an App and it works well when evaluating the agent and using the in memory runner. I can also successfully deploy the agent to Agent Engine (updating my existing agent). However, when I invoke the agent, I get the error: Input should be a valid dictionary or instance of BaseAgent [type=model_type, input_value=App(name='oracle', root_a...esumability_config=None), input_type=App].
I suspect I am configuring the agent incorrectly when deploying but I can't find any alternatives to my current approach. An example of my agent and deployment configuration is below:
app = App( name="agent_name", root_agent=root_agent, context_cache_config=ContextCacheConfig( min_tokens=4096, ttl_seconds=600, cache_intervals=10, ), )
agent_engines.update( resource_name=existing_agent.resource_name, agent_engine=AdkApp(agent=app), display_name="Agent", ... )
To Reproduce
- Create an agent and wrap it as an App with caching configuration
- Deploy the agent using the python API by wrapping the App as an AdkApp (I have tried using the App directly but the deployment fails).
- Invoke the agent using the python API
Expected behavior
I expect the agent to behave as normal. However, I get a runtime error due to a Pydantic model validation issue.
Screenshots
I have attached a screenshot of the logs.
Desktop (please complete the following information):
- OS: Linux
- Python version(python -V): 3.13.5
- ADK version(pip show google-adk): 1.20.0
Model Information:
- Are you using LiteLLM: No
- Which model is being used(e.g. gemini-2.5-pro): gemini-2.5-flash / gemini-2.5-flash-lite
Additional context
I have tried on both ADK 1.19.0 and 1.20.0.
