litellm/tests/unit/llms/gemini
zoveki fb18c5cb3a
fix(decisions): keep systemone confidence, extra fields and proxy cost on litellm_proxy calls (#53195)
* fix(decisions): keep litellm_proxy calls in the caller's shape and bill the proxy's cost

A systemone call now goes to the proxy's /v1/systemone unchanged, assets and
criteria included, and a decisions call keeps going to /v1/decisions. The
call's cost comes from the proxy's x-litellm-response-cost header, extra
fields such as decision_id reach the caller, and the missing-key error names
LITELLM_PROXY_API_KEY. On the proxy, use_litellm_proxy stays a deployment
setting that a request body cannot set.

(cherry picked from commit c6f2379abe53ca80f221aa99abdbb941efd24962)

* fix(decisions): forward safety_identifier on litellm_proxy systemone calls

The proxy's /v1/systemone accepts safety_identifier, so the systemone hop now sends it instead of refusing the call or dropping the field under drop_params.

(cherry picked from commit 787aa1cc33c2ca3b756bdf24d34b7214734061f3)

* test(decisions): cover the litellm_proxy cost fallback and systemone images

A proxied call with no usable cost header now has to bill the same model price a direct call bills, a zero cost header has to bill zero, and the systemone call has to forward its images

(cherry picked from commit 7c0892dbd2d5b36d814155531e4e76ab54358f0e)

* fix(decisions): pass on proxied answers that carry no confidence

The proxy already checked each answer against its own deployment's provider, so a Parallel AI choice or score answer with no confidence now reaches the caller instead of failing after the proxy billed it

(cherry picked from commit 350afdffcfa4d9a4e1b315a5cc56bb0eb962af9c)

* fix(decisions): ignore use_litellm_proxy in request fallback targets

The decisions endpoints already drop use_litellm_proxy and model_info from the top level of a request body, since both are deployment settings. Fallback targets in the body now drop them too, in fallbacks, context_window_fallbacks, content_policy_fallbacks and the same lists under router_settings_override, so only deployment config turns the flag on

(cherry picked from commit e84aac682fe0920e54d189d2bf3599372cda8952)

* fix(decisions): send the caller's drop_params to the litellm_proxy hop

A proxied decisions or systemone call with drop_params still failed when the proxy's deployment could not take safety_identifier, since the flag stayed on the client. The call now sends drop_params: true to the proxy, which drops what the deployment it picks cannot take

* refactor(decisions): drop the litellm_proxy hop's unreachable missing key message

The hop sets api_key_required to False, which gates the only caller of missing_api_key_message, so the override never ran

* fix(decisions): send only a per-call drop_params to the litellm_proxy hop

A proxy-wide or SDK-wide drop_params went to the upstream proxy on every hop call, so an upstream that is not a LiteLLM proxy refused the unknown parameter. The hop now gets drop_params only when the caller set it on that call, and the global setting stays on the client the way chat through litellm_proxy keeps it

* fix(gemini): name the model on Gemini systemone answers

Gemini's systemone answers carry no model, so a direct call and a litellm_proxy hop answered model null while the decisions shape answered gemini/gemini-decision-1. A Gemini systemone call now fills in the provider and model it was sent to when the answer leaves it out

---------

Co-authored-by: mateo-berri <277851410+mateo-berri@users.noreply.github.com>
2026-11-21 12:47:10 -08:00
..
audio_transcription fix(audio-transcription): keep transcripts out of transcription error messages (#50137) 2026-11-05 18:07:15 -08:00
batches feat(gemini): file-backed batch jobs on /v1/batches with output download and spend tracking (#51032) 2026-11-11 12:00:32 -08:00
decisions fix(decisions): keep systemone confidence, extra fields and proxy cost on litellm_proxy calls (#53195) 2026-11-21 12:47:10 -08:00
files fix(proxy): org admin spend log scope and gemini file id parsing (#52943) 2026-11-19 22:08:27 +00:00
google_genai fix(streaming): keep merged think tags balanced and split SSE lines only on CR/LF (#48755) 2026-10-28 17:00:29 -07:00
image_edit fix(gemini): return n images for image generations and edits when n > 1 (#52103) 2026-11-16 14:50:13 -08:00
image_generation test: move whole-unit legacy test files into tests/unit and delete dead skips (#44807) 2026-10-07 05:02:28 +00:00
realtime fix(gemini realtime): report barge-in as cancelled response.done (#52596) 2026-11-20 17:56:24 -08:00
videos feat(videos): add first-class OpenRouter video request fields (#50319) 2026-11-06 16:50:48 -08:00
__init__.py
test_cost_calculator.py test: move tests/test_litellm/llms into tests/unit/llms (#43191) 2026-09-25 12:43:23 -07:00
test_gemini_client_setup.py chore(cost-map): remove the 52 rows whose provider retired them before 2026 (#49974) 2026-11-03 16:23:06 -08:00
test_gemini_common_utils.py fix(vertex-ai): send union-root tool schemas as parametersJsonSchema (#51835) 2026-11-14 17:29:37 -05:00
test_gemini_image_generation_transformation.py fix(gemini): return n images for image generations and edits when n > 1 (#52103) 2026-11-16 14:50:13 -08:00
test_gemini_streaming.py test: migrate local_testing SDK and provider tests out of build_and_test (#45760) 2026-10-10 23:14:25 +00:00
test_gemini_tts.py fix(gemini)!: answer 400 for an unsupported chat audio format, drop it under drop_params (#49423) 2026-11-02 04:33:19 -08:00
test_image_usage_transformation.py fix(images): normalize null cached token counts (#52857) 2026-11-19 17:49:26 +00:00