mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-25 22:20:43 +00:00
* test(vertex_ai): cover Gemini malformed replies with no output A non-streaming Gemini reply that ends in MALFORMED_FUNCTION_CALL or MALFORMED_RESPONSE with no output comes back as a 200 stop with empty content, so retries and fallbacks never run. These tests expect a retriable 500 on chat completions, messages and responses, a fallback to the backup model, and billed tokens on the failure log, while replies with any output keep their 200. * fix(vertex_ai): fail Gemini malformed replies with no output so retries run When every Gemini candidate ends in MALFORMED_FUNCTION_CALL or MALFORMED_RESPONSE with no text, tool call, image or audio, raise a 500 that names the finish reason instead of returning a 200 stop with empty content. The failure log keeps the tokens Google billed. Replies with any output keep today's shape. * fix(vertex_ai): keep Gemini pass-through spend logs and bill the failed attempt like other 200 errors The malformed check now runs only on the live completion path, so the Gemini and Vertex pass-through loggers still bill a malformed reply instead of failing to log it. The failed attempt is recorded the same way OpenRouter records an error inside a 200, so a later retry or fallback can carry it. Tests now cover image, audio and legacy function-call output, the pass-through spend, and a smaller integration matrix on gemini-4-carbon. * fix(vertex_ai): type the native finish reason read in the Gemini malformed check * refactor(vertex_ai): return the Gemini malformed failure as a value and raise it at the request boundary * fix(vertex_ai): keep token counts out of the Gemini malformed error so it is never remapped to a client error The Vertex error mapper reads a bare 403 in the message as a permission error, so a reply that billed exactly 403 tokens would have skipped retries. The billed tokens stay on the spend log. |
||
|---|---|---|
| .. | ||
| llm_provider_handlers | ||
| __init__.py | ||
| test_carry_guardrail_logging_info.py | ||
| test_codex_passthrough_endpoints.py | ||
| test_cursor_cli_passthrough_endpoints.py | ||
| test_deepgram_ws_passthrough_routes.py | ||
| test_injected_stream_usage.py | ||
| test_llm_pass_through_endpoints.py | ||
| test_llm_passthrough_endpoints.py | ||
| test_managed_id_rewriter.py | ||
| test_method_specific_routing.py | ||
| test_pass_through_endpoints.py | ||
| test_passthrough_auth_default.py | ||
| test_passthrough_endpoint_router.py | ||
| test_passthrough_endpoints_common_utils.py | ||
| test_passthrough_guardrail_block_otel_span.py | ||
| test_passthrough_guardrails.py | ||
| test_passthrough_guardrails_field_targeting.py | ||
| test_passthrough_post_call_guardrails.py | ||
| test_streaming_handler.py | ||
| test_streaming_handler_interrupt.py | ||
| test_success_handler.py | ||
| test_upstream_usage_headers.py | ||
| test_vector_store_fallbacks.py | ||
| test_vertex_ai_batch_passthrough.py | ||
| test_vertex_ai_live_passthrough.py | ||
| test_vertex_passthrough_load_balancing.py | ||
| test_watsonx_proxy_route.py | ||