litellm/tests/unit/llms/gemini
chaznm a527f1a7c7
fix(vertex_ai): honor Gemini image size and imageConfig controls on generation and edits (#53580)
* fix(vertex_ai): reject unmappable Gemini image sizes and forward edit image controls

* fix(vertex_ai): honor multipart drop_params and snake_case imageConfig keys on Gemini image edits

* fix(proxy): fold imageConfig[key] multipart fields into imageConfig on image edits

* fix(images): fold imageConfig edit fields only where the provider takes imageConfig

- Fold imageConfig[key] multipart edit fields in the SDK edit path, only for providers whose edit config lists imageConfig, deep-merged over a JSON imageConfig with bracket keys winning
- Let background auto or opaque, moderation auto and output_compression 100 pass on Vertex Gemini without a 400
- Accept image_config as an alias of imageConfig on Vertex Gemini generation and edits
- Keep drop_params, additional_drop_params and the params they drop out of OpenAI-style multipart edit forms

* fix(images): cap and validate imageConfig bracket fields and keep OpenAI-only params as silent drops

* fix(images): drop additional_drop_params before folding, forward edit fields through litellm_proxy hops, merge imageConfig spellings

A deployment's additional_drop_params now removes imageConfig bracket fields before the fold, so its 64-field cap no longer answers 400 for a param the deployment drops

A litellm_proxy hop forwards drop_params and the imageConfig fields to the next proxy as sent, so the proxy that serves the Gemini model folds and drops them

Snake_case bracket keys are renamed to camelCase before the merge, and imageConfig and image_config sent together merge with imageConfig winning a clash

* fix(images): reject bracket fields beside a non-object imageConfig, drop them under additional_drop_params, camelCase nested keys

imageConfig[...] fields sent beside an imageConfig that is not a JSON object now answer 400 on gemini/ too, as vertex_ai/ already did, and drop_params keeps the bracket fields

OpenAI-style multipart edits leave out bracket fields whose root additional_drop_params lists, so imageConfig[aspectRatio] no longer reaches a deployment that drops imageConfig

The fold camelCases nested imageConfig keys on both sides before merging, so a snake_case bracket key overrides a nested camelCase JSON key instead of sending both

* fix(images): drop a bracket field additional_drop_params names exactly on image edits

---------

Co-authored-by: mateo-berri <277851410+mateo-berri@users.noreply.github.com>
2026-11-23 09:05:25 -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(vertex_ai): pin const values on Gemini tool and response schemas (#53413) 2026-11-22 18:27:58 +00:00
image_edit fix(vertex_ai): honor Gemini image size and imageConfig controls on generation and edits (#53580) 2026-11-23 09:05:25 -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 feat(gemini): support Gemini Live Avatar on Vertex AI realtime (#53270) 2026-11-21 15:06:59 -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_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