mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-25 22:20:43 +00:00
* fix(google_genai): honor snake_case generation_config on generateContent
Read the request config from generationConfig or generation_config in the shared setup step, and map maxOutputTokens, topP and stopSequences from either spelling on the non-Gemini adapter path, so a snake_case output cap is no longer dropped.
* fix(google_genai): read snake_case generation_config in the rate limiter
* test(google_genai): cover the limiter's Google config precedence
Covers an empty config next to a filled generationConfig and both config spellings in one request, for the cap check and the injected cap, and types the new test params as Mapping.
* fix(google_genai): give a custom generateContent hook an empty config as {} again
* fix(google_genai): read quoted generationConfig numbers and answer 400 for an invalid config
The adapter now reads temperature, the output cap, topP and the stop
sequences as Google types them, so a quoted number like "16" reaches
non-Gemini models as a number. A config that is not an object, or a
field value Google refuses, answers 400 in either spelling before any
provider call, where camelCase answered 500 and snake_case was dropped
* fix(google_genai): read numbers the way the Gemini API types them and accept a typed GenerateContentConfig
* fix(google_genai): read signed and leading-dot number strings and refuse non-finite floats as the Gemini API does
* fix(google_genai): match number strings without backtracking so a long malformed value cannot stall the event loop
---------
Co-authored-by: mateo-berri <277851410+mateo-berri@users.noreply.github.com>
|
||
|---|---|---|
| .. | ||
| __init__.py | ||
| test_google_genai_adapter.py | ||
| test_google_genai_adapter_fixes.py | ||
| test_google_genai_handler.py | ||
| test_google_genai_main.py | ||
| test_google_genai_streaming_iterator.py | ||
| test_google_genai_transformation.py | ||