mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-21 00:21:49 +00:00
fix(gemini): keep the 2048 cache minimum on Gemini 2.5 Pro only, per Google's live cachedContents API
This commit is contained in:
parent
3289e22834
commit
2303379c20
3 changed files with 6 additions and 9 deletions
|
|
@ -25066,7 +25066,6 @@
|
|||
"supports_parallel_function_calling": true,
|
||||
"supports_pdf_input": true,
|
||||
"supports_prompt_caching": true,
|
||||
"prompt_cache_min_tokens": 2048,
|
||||
"supports_reasoning": true,
|
||||
"supports_response_schema": true,
|
||||
"supports_system_messages": true,
|
||||
|
|
@ -27139,7 +27138,6 @@
|
|||
"supports_parallel_function_calling": true,
|
||||
"supports_pdf_input": true,
|
||||
"supports_prompt_caching": true,
|
||||
"prompt_cache_min_tokens": 2048,
|
||||
"supports_reasoning": true,
|
||||
"supports_response_schema": true,
|
||||
"supports_system_messages": true,
|
||||
|
|
|
|||
|
|
@ -25066,7 +25066,6 @@
|
|||
"supports_parallel_function_calling": true,
|
||||
"supports_pdf_input": true,
|
||||
"supports_prompt_caching": true,
|
||||
"prompt_cache_min_tokens": 2048,
|
||||
"supports_reasoning": true,
|
||||
"supports_response_schema": true,
|
||||
"supports_system_messages": true,
|
||||
|
|
@ -27139,7 +27138,6 @@
|
|||
"supports_parallel_function_calling": true,
|
||||
"supports_pdf_input": true,
|
||||
"supports_prompt_caching": true,
|
||||
"prompt_cache_min_tokens": 2048,
|
||||
"supports_reasoning": true,
|
||||
"supports_response_schema": true,
|
||||
"supports_system_messages": true,
|
||||
|
|
|
|||
|
|
@ -1396,14 +1396,15 @@ class TestContextCachingEndpoints:
|
|||
# Restart the patcher so teardown_method can stop it cleanly
|
||||
self._token_check_patcher.start()
|
||||
|
||||
@pytest.mark.parametrize("model", ["gemini-2.5-flash", "gemini-2.5-pro"])
|
||||
def test_check_and_create_cache_skips_between_default_and_gemini_2_5_minimum(
|
||||
self, model, local_model_cost_map
|
||||
def test_check_and_create_cache_skips_between_default_and_gemini_2_5_pro_minimum(
|
||||
self, local_model_cost_map
|
||||
):
|
||||
"""Gemini 2.5 Flash and Pro need 2048 cached tokens, twice the provider-agnostic default.
|
||||
"""Gemini 2.5 Pro needs 2048 cached tokens, twice the provider-agnostic default.
|
||||
|
||||
Content between the two used to reach Google's cachedContents endpoint and 400.
|
||||
Content between the two used to reach Google's cachedContents endpoint and 400
|
||||
with "Cached content is too small".
|
||||
"""
|
||||
model = "gemini-2.5-pro"
|
||||
self._token_check_patcher.stop()
|
||||
|
||||
cached_messages = [
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue