Skip to content

Commit 96d895d

Browse files
HojlandDouweM
andauthored
add google cached content usage (#2832)
Co-authored-by: Douwe Maan <[email protected]>
1 parent 5709c23 commit 96d895d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

pydantic_ai_slim/pydantic_ai/models/google.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,12 @@ class GoogleModelSettings(ModelSettings, total=False):
129129
See <https://ai.google.dev/api/generate-content#MediaResolution> for more information.
130130
"""
131131

132+
google_cached_content: str
133+
"""The name of the cached content to use for the model.
134+
135+
See <https://ai.google.dev/gemini-api/docs/caching> for more information.
136+
"""
137+
132138

133139
@dataclass(init=False)
134140
class GoogleModel(Model):
@@ -377,6 +383,7 @@ async def _build_content_and_config(
377383
thinking_config=model_settings.get('google_thinking_config'),
378384
labels=model_settings.get('google_labels'),
379385
media_resolution=model_settings.get('google_video_resolution'),
386+
cached_content=model_settings.get('google_cached_content'),
380387
tools=cast(ToolListUnionDict, tools),
381388
tool_config=tool_config,
382389
response_mime_type=response_mime_type,

0 commit comments

Comments
 (0)