litellm/tests/unit/proxy/image_endpoints
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
..
__init__.py
test_azure_routes.py test: migrate SDK and proxy-booting legacy CircleCI tests to their tiers (#45758) 2026-10-11 00:17:21 -07:00
test_endpoints.py fix(vertex_ai): honor Gemini image size and imageConfig controls on generation and edits (#53580) 2026-11-23 09:05:25 -08:00