litellm/tests/integration/translation/responses
Sukhdeep 87478c7b6d
fix(gemini): do not inject temperature for Gemini 3+ models when omitted (#45107)
* fix(gemini): do not inject temperature for Gemini 3+ models when omitted

map_openai_params added temperature=1.0 to every Gemini 3+ request that did not set one, on both the gemini and vertex_ai routes. Google is deprecating temperature, top_p and top_k for Gemini 3+ and says upcoming models will reject them, so this default turns a request that never set temperature into one that will fail

An omitted temperature now falls back to Google's own default, which their docs give as 1.0 for all Gemini 3 models. Explicit temperature, top_p and top_k are still forwarded

Fixes #38663

* test(gemini): annotate sampling regression tests

* test(gemini): drop the injected temperature from Gemini translation cases

The nine Gemini base cases for chat completions, responses and messages send no temperature, so the provider request no longer carries the removed 1.0 default. Each new body was sent to the real Gemini API for gemini-3.5-flash, gemini-3.8-flash and gemini-3.1-pro-preview and returned 200, and the stored provider responses are unchanged

* test(gemini): drop the default-temperature wording from the thinking level test docstring

* test(gemini): cover omitted and explicit sampling on both Gemini routes

---------

Co-authored-by: mateo-berri <277851410+mateo-berri@users.noreply.github.com>
2026-10-12 20:26:49 +00:00
..
bases fix(gemini): do not inject temperature for Gemini 3+ models when omitted (#45107) 2026-10-12 20:26:49 +00:00
basic test(integration): basic translation cases for the bedrock_mantle route (#44750) 2026-10-06 03:17:34 +00:00
sampling fix(gemini): do not inject temperature for Gemini 3+ models when omitted (#45107) 2026-10-12 20:26:49 +00:00
__init__.py test(integration): anthropic-route basic translation cases for six Claude models on messages, chat completions and responses (#44607) 2026-10-05 18:24:01 +00:00