mirror of
https://github.com/BerriAI/litellm.git
synced 2026-12-02 01:28:38 +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. |
||
|---|---|---|
| .. | ||
| __init__.py | ||
| test_context_circulation.py | ||
| test_function_call_args_serialization.py | ||
| test_gemini_image_url_missing_field.py | ||
| test_gemini_streaming_tool_call_finish_reason.py | ||
| test_grounding_requests.py | ||
| test_long_decode.py | ||
| test_rejected_thought_signature_retry.py | ||
| test_thought_signature_in_tool_call_id.py | ||
| test_tool_call_followed_by_text_assistant.py | ||
| test_transformation.py | ||
| test_vertex_ai_gemini_transformation.py | ||
| test_vertex_and_google_ai_studio_gemini.py | ||
| test_vertex_gemini_unbound_local_error.py | ||