litellm/tests/test_litellm/llms/vertex_ai
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
..
agent_engine test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
audio_transcription fix(model_prices): update provider and web search pricing 2026-09-08 19:28:04 +00:00
batches fix(vertex_ai): route endpoint resolution through safe_get to guard caller-supplied api_base 2026-09-03 20:38:24 -04:00
context_caching test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
files fix(vertex_ai): address batch review findings 2026-09-03 19:49:37 -04:00
gemini fix(vertex_ai): return 400 for invalid reasoning_effort instead of 500 2026-09-11 10:00:35 -07:00
gemini_embeddings fix(vertex): preserve Gemini Embedding 2 usageMetadata for cost tracking (#31354) 2026-06-25 19:53:16 -07:00
image_edit style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
image_generation test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
interactions feat(vertex_ai): add native Vertex AI Interactions API support 2026-08-25 09:55:13 -07:00
multimodal_embeddings test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
realtime fix(gemini-realtime): drop the native-audio speechConfig strip on Google AI Studio too 2026-08-26 15:06:23 -07:00
rerank fix(tests): remove importlib.reload of http_handler that breaks client injection in later tests (#34336) 2026-07-23 01:11:35 +00:00
text_to_speech fix(vertex_ai): bill Lyria per generation, not per audio second 2026-09-05 22:34:31 -07:00
vertex_ai_partner_models perf: move Anthropic, Vertex Anthropic, Ollama and HF template fetches off the event loop (#40311) 2026-09-08 15:53:43 -07:00
vertex_gemma_models fix(exceptions): map upstream status codes for providers with no exception_type branch 2026-08-26 00:47:28 -07:00
videos test: collapse blank lines left by removed tests 2026-09-08 02:21:55 +00:00
__init__.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_bge_embedding.py test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
test_bge_response_transformation.py test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
test_gemini_batch_embeddings.py test(batches): move orphan tests into tests/test_litellm for CI coverage (#30510) 2026-06-16 10:20:59 -07:00
test_gemini_empty_properties.py test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
test_gemini_header_forwarding.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_http_status_201.py Litellm fix GitHub action testing (#11163) 2025-05-26 14:41:42 -07:00
test_vertex.py test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
test_vertex_ai_batch_transformation.py fix: cover provider path traversal variants 2026-04-29 22:29:09 -07:00
test_vertex_ai_common_utils.py Merge pull request #30856 from emerzon/litellm_vertex_lyria_models 2026-09-05 23:12:25 -07:00
test_vertex_ai_psc_endpoint_support.py fix(vertex_ai): build full request path when custom api_base has no path (#32367) 2026-07-07 13:17:07 -07:00
test_vertex_ai_search_vector_store_transformation.py feat(vector-stores): forward per-request params to Vertex AI Search (#29459) 2026-06-02 12:51:20 -07:00
test_vertex_gemini_gcs_uri_mime.py test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
test_vertex_global_url_support.py fix(vertex_ai): use aiplatform.{geo}.rep.googleapis.com for multi-region locations (#26281) 2026-04-23 15:58:02 -07:00
test_vertex_image_generation.py test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
test_vertex_llm_base.py fix(vertex_ai): graft default vertex path when api_base has a version-only path (#38986) 2026-08-31 12:56:34 -07:00
test_vertex_model_garden_openapi.py [internal copy of #29003] fix(vertex_ai): use user-supplied api_base as is for Model Garden OpenAI-compat path (#29530) 2026-06-02 16:15:25 -07:00
test_vertex_passthrough_logging_handler.py test(vertex_ai): keep imagen predict passthrough off the Lyria audio path 2026-09-05 22:59:57 -07:00