mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-15 09:12:18 +00:00
* feat: support native generateContent in CustomLLM Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix: preserve custom generateContent accounting and built-in priority Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix: forward custom generateContent success callbacks Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix: preserve custom generateContent failure callbacks Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix: retain async callbacks across generateContent fallback Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix(google_genai): scope custom generateContent hooks to native fields and stream only with a stream hook * fix(google_genai): log custom adapter calls on the caller's logging object and reject untranslatable config Custom adapter calls now share the caller's logging object, so the proxy's deferred logging covers them and one request logs one row under the caller's call id and call type. Native hook responses log from any pydantic, SDK, or dict shape, per-request prices apply to custom handlers, and a missing stream hook or a generationConfig key the adapter cannot send answers 400 * fix(google_genai): return custom hook objects as their camelCase dict so the router tags the deployment * fix(google_genai): keep tool args, drop SDK-only fields, and let routers retry custom legs that cannot stream Tool call args and function responses keep the caller's keys and null values. SDK objects no longer send sdkHttpResponse, automaticFunctionCallingHistory or parsed to the client or the logs. A custom leg without a stream hook answers 500 like CustomLLM's other unimplemented hooks, so a mixed router group retries the request on another leg. The wire-value walk is depth capped for the recursive function check * fix(google_genai): keep router legs serving chat after a custom stream without a hook, and accept config the adapter already meets * fix(google_genai): reject JSON mode a custom leg's completion adapter cannot send The custom-leg generationConfig check now accepts responseMimeType and response schema keys only when the adapter sends them as response_format, or when they ask for plain text. JSON mode without an object schema answers 400 unless drop_params is set * fix(google_genai): send a custom hook's dict back without SDK-only fields A hook that returns a dumped google-genai response as a dict sent its snake_case keys, parsed, sdk_http_response and automatic_function_calling_history to the client, past the guardrail that rewrites only candidate text. Dicts now go back as the same filtered camelCase body as every other hook return, and the router tags that copy instead of writing into the hook's own dict --------- Co-authored-by: mateo <277851410+mateo-berri@users.noreply.github.com> Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@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 | ||