Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/google/adk/models/gemini_context_cache_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ async def _create_gemini_cache(

with tracer.start_as_current_span("create_cache") as span:
# Prepare cache contents (first N contents + system instruction + tools)
cache_contents = llm_request.contents[:cache_contents_count]
cache_contents = llm_request.contents[:cache_contents_count] or None

cache_config = types.CreateCachedContentConfig(
contents=cache_contents,
Expand Down
2 changes: 2 additions & 0 deletions tests/unittests/agents/test_gemini_context_cache_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -989,6 +989,8 @@ async def test_fingerprint_only_metadata_transitions_to_active_cache(
assert result_2.contents_count == 0 # Preserved from prefix
assert result_2.invocations_used == 1
self.manager.genai_client.aio.caches.create.assert_called_once()
create_call = self.manager.genai_client.aio.caches.create.call_args
assert create_call.kwargs["config"].contents is None

async def test_dynamic_instruction_does_not_break_initial_cache_fingerprint(
self,
Expand Down
Loading