I followed documentation in Caching | Gemini API | Google AI for Developers to cache some content into gemini-1.5-flash-002, and I want my agent (from the google adk) to access the cached content. I tried adding the “config” parameter that is in the caching documentation and it is not supported by the agent, which left me wondering if the agent can use cached content at all, and if so, how?
This is the snippet I was trying and returns “Extra inputs are not permitted [type=extra_forbidden, input_value=GenerateContentConfig(htt…e, thinking_config=None), input_type=GenerateContentConfig]”
root_agent = Agent(
model=“gemini-1.5-flash-002”,
name=“RootAgent”,
description=“Root agent responsible for …”,
include_contents=True,
instruction=system_prompt,
tools=[
AgentTool(agent=first_agent),
get_info,
],
config=types.GenerateContentConfig(cached_content=cache.name)
)
1 Like