mirror of
https://github.com/BerriAI/litellm.git
synced 2026-12-02 01:28:38 +00:00
* fix(elevenlabs): send list transcription params as repeated form fields * test(elevenlabs): assert the complete multipart field set for transcription params * fix(elevenlabs): send object params as JSON and flatten extra_body into form fields ElevenLabs reads additional_formats and webhook_metadata as JSON strings, so dicts and lists of objects now go out as JSON instead of Python repr text. None items in a list are dropped instead of being sent as the keyterm "None". Fields passed through extra_body are now sent as their own form fields, with top-level params taking precedence, matching the xAI transcription config. * fix(elevenlabs): keep extra_body from setting model_id and drop None items in JSON lists extra_body can no longer set model_id or nest another extra_body, matching how other providers drop the routing key from extra_body. None items are now dropped from lists sent as JSON too, and nested mappings that are not dicts are encoded as JSON objects instead of their repr. New cases cover top-level precedence over extra_body, None values inside extra_body, nested lists and values JSON cannot encode. * fix(elevenlabs): let extra_body win, keep a client model_id from replacing the model, and encode non-string mapping keys * fix(elevenlabs): let a top-level param win over extra_body like xAI transcription, and keep bytes and enum mapping keys * fix(elevenlabs): reject form values that cannot be encoded with a 400 before sending A mapping in a form field goes out as json.dumps writes it, and a read-only view of a mapping goes out like the mapping itself. A value that json.dumps or str() cannot encode now fails with a fixed-text 400 before anything is sent. That covers a mapping key JSON cannot hold, a mapping that holds itself, an int too long for text, nesting past the stack and a __str__ that raises. A non-string extra_body key fails the same way. The Router does not retry these, and no error repeats the value * fix(elevenlabs): reject a model_id other than the model, and drop instead of failing under drop_params Top-level values now win over extra_body before any check or encoding, so an overridden extra_body value never causes a 400 and a dropped top-level value never falls back to it. extra_body keys must be real strings --------- Co-authored-by: mateo-berri <277851410+mateo-berri@users.noreply.github.com> |
||
|---|---|---|
| .. | ||
| audio_transcription | ||
| realtime | ||
| __init__.py | ||
| test_elevenlabs_text_to_speech_transformation.py | ||