litellm/tests/test_litellm/llms/vertex_ai/gemini
ryan-crabbe-berri f72b117b21 fix(vertex_ai): return 400 for invalid reasoning_effort instead of 500
Both reasoning_effort mappers ended their if/elif chain in a bare ValueError.
exception_type() has no branch for ValueError, so it fell through to the shared
APIConnectionError fallback and the proxy answered a malformed client request
with a retryable HTTP 500 carrying no hint of the accepted values.

Raise UnsupportedParamsError (400) instead, listing the supported set, matching
what the Anthropic and Bedrock transforms already do and what this same file
already does at its five other param-validation sites.

This also covers 'xhigh' and 'max', which are members of litellm's own
REASONING_EFFORT literal but have no Gemini mapping, so callers bridging from
OpenAI-shaped code were hitting the 500 without typing anything wrong.

Fixes #40474

Claude-Session: https://claude.ai/code/session_01XT1qsbjLwnhiN5sQ2hNUxr
2026-09-11 10:00:35 -07:00
..
__init__.py test: run the 30 test files stranded in the second mirror (#37595) 2026-08-20 10:59:43 -07:00
test_context_circulation.py chore: litellm oss staging 250626 (#31305) 2026-06-25 21:00:28 -07:00
test_function_call_args_serialization.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_gemini_image_url_missing_field.py Litellm oss staging (#28161) 2026-05-18 16:27:44 -07:00
test_gemini_streaming_tool_call_finish_reason.py feat: litellm oss 110626 (#30202) 2026-06-11 22:30:26 -07:00
test_grounding_requests.py Merge branch 'litellm_internal_staging' of https://github.com/BerriAI/litellm into litellm_gemini_maps_grounding_cost 2026-08-26 16:27:40 -07:00
test_thought_signature_in_tool_call_id.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_tool_call_followed_by_text_assistant.py Litellm oss staging 030626 (#29578) 2026-06-03 11:01:51 -07:00
test_transformation.py fix(image_handling): keep DNS, signing, and Vertex Gemini fetches off the event loop 2026-09-04 20:54:40 -07:00
test_vertex_ai_gemini_transformation.py feat(gemini): day-0 pricing for gemini-3.8-flash 2026-09-02 08:04:14 -07:00
test_vertex_and_google_ai_studio_gemini.py fix(vertex_ai): return 400 for invalid reasoning_effort instead of 500 2026-09-11 10:00:35 -07:00
test_vertex_gemini_unbound_local_error.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00