mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 03:04:13 +00:00
(feat) Support audio
, modalities
params (#6304)
* add audio, modalities param * add test for gpt audio models * add get_supported_openai_params for GPT audio models * add supported params for audio * test_audio_output_from_model * bump openai to openai==1.52.0 * bump openai on pyproject * fix audio test * fix test mock_chat_response * handle audio for Message * fix handling audio for OAI compatible API endpoints * fix linting * fix mock dbrx test
This commit is contained in:
parent
aab19cdba9
commit
5216693047
15 changed files with 290 additions and 23 deletions
|
@ -2483,6 +2483,8 @@ def get_optional_params( # noqa: PLR0915
|
|||
stop=None,
|
||||
max_tokens=None,
|
||||
max_completion_tokens=None,
|
||||
modalities=None,
|
||||
audio=None,
|
||||
presence_penalty=None,
|
||||
frequency_penalty=None,
|
||||
logit_bias=None,
|
||||
|
@ -2562,6 +2564,8 @@ def get_optional_params( # noqa: PLR0915
|
|||
"stop": None,
|
||||
"max_tokens": None,
|
||||
"max_completion_tokens": None,
|
||||
"modalities": None,
|
||||
"audio": None,
|
||||
"presence_penalty": None,
|
||||
"frequency_penalty": None,
|
||||
"logit_bias": None,
|
||||
|
@ -5734,6 +5738,7 @@ def convert_to_model_response_object( # noqa: PLR0915
|
|||
role=choice["message"]["role"] or "assistant",
|
||||
function_call=choice["message"].get("function_call", None),
|
||||
tool_calls=tool_calls,
|
||||
audio=choice["message"].get("audio", None),
|
||||
)
|
||||
finish_reason = choice.get("finish_reason", None)
|
||||
if finish_reason is None:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue