2828from ....types .chat .chat_completion import ChatCompletion
2929from ....types .chat .chat_completion_chunk import ChatCompletionChunk
3030from ....types .chat .parsed_chat_completion import ParsedChatCompletion
31+ from ....types .chat .chat_completion_modality import ChatCompletionModality
3132from ....types .chat .chat_completion_tool_param import ChatCompletionToolParam
33+ from ....types .chat .chat_completion_audio_param import ChatCompletionAudioParam
3234from ....types .chat .chat_completion_message_param import ChatCompletionMessageParam
3335from ....types .chat .chat_completion_stream_options_param import ChatCompletionStreamOptionsParam
3436from ....types .chat .chat_completion_tool_choice_option_param import ChatCompletionToolChoiceOptionParam
@@ -61,6 +63,7 @@ def parse(
6163 * ,
6264 messages : Iterable [ChatCompletionMessageParam ],
6365 model : Union [str , ChatModel ],
66+ audio : Optional [ChatCompletionAudioParam ] | NotGiven = NOT_GIVEN ,
6467 response_format : type [ResponseFormatT ] | NotGiven = NOT_GIVEN ,
6568 frequency_penalty : Optional [float ] | NotGiven = NOT_GIVEN ,
6669 function_call : completion_create_params .FunctionCall | NotGiven = NOT_GIVEN ,
@@ -70,6 +73,7 @@ def parse(
7073 max_completion_tokens : Optional [int ] | NotGiven = NOT_GIVEN ,
7174 max_tokens : Optional [int ] | NotGiven = NOT_GIVEN ,
7275 metadata : Optional [Dict [str , str ]] | NotGiven = NOT_GIVEN ,
76+ modalities : Optional [List [ChatCompletionModality ]] | NotGiven = NOT_GIVEN ,
7377 n : Optional [int ] | NotGiven = NOT_GIVEN ,
7478 parallel_tool_calls : bool | NotGiven = NOT_GIVEN ,
7579 presence_penalty : Optional [float ] | NotGiven = NOT_GIVEN ,
@@ -153,6 +157,7 @@ def parser(raw_completion: ChatCompletion) -> ParsedChatCompletion[ResponseForma
153157 {
154158 "messages" : messages ,
155159 "model" : model ,
160+ "audio" : audio ,
156161 "frequency_penalty" : frequency_penalty ,
157162 "function_call" : function_call ,
158163 "functions" : functions ,
@@ -161,6 +166,7 @@ def parser(raw_completion: ChatCompletion) -> ParsedChatCompletion[ResponseForma
161166 "max_completion_tokens" : max_completion_tokens ,
162167 "max_tokens" : max_tokens ,
163168 "metadata" : metadata ,
169+ "modalities" : modalities ,
164170 "n" : n ,
165171 "parallel_tool_calls" : parallel_tool_calls ,
166172 "presence_penalty" : presence_penalty ,
@@ -198,6 +204,7 @@ def stream(
198204 * ,
199205 messages : Iterable [ChatCompletionMessageParam ],
200206 model : Union [str , ChatModel ],
207+ audio : Optional [ChatCompletionAudioParam ] | NotGiven = NOT_GIVEN ,
201208 response_format : completion_create_params .ResponseFormat | type [ResponseFormatT ] | NotGiven = NOT_GIVEN ,
202209 frequency_penalty : Optional [float ] | NotGiven = NOT_GIVEN ,
203210 function_call : completion_create_params .FunctionCall | NotGiven = NOT_GIVEN ,
@@ -207,6 +214,7 @@ def stream(
207214 max_completion_tokens : Optional [int ] | NotGiven = NOT_GIVEN ,
208215 max_tokens : Optional [int ] | NotGiven = NOT_GIVEN ,
209216 metadata : Optional [Dict [str , str ]] | NotGiven = NOT_GIVEN ,
217+ modalities : Optional [List [ChatCompletionModality ]] | NotGiven = NOT_GIVEN ,
210218 n : Optional [int ] | NotGiven = NOT_GIVEN ,
211219 parallel_tool_calls : bool | NotGiven = NOT_GIVEN ,
212220 presence_penalty : Optional [float ] | NotGiven = NOT_GIVEN ,
@@ -259,6 +267,7 @@ def stream(
259267 self ._client .chat .completions .create ,
260268 messages = messages ,
261269 model = model ,
270+ audio = audio ,
262271 stream = True ,
263272 response_format = _type_to_response_format (response_format ),
264273 frequency_penalty = frequency_penalty ,
@@ -269,6 +278,7 @@ def stream(
269278 max_completion_tokens = max_completion_tokens ,
270279 max_tokens = max_tokens ,
271280 metadata = metadata ,
281+ modalities = modalities ,
272282 n = n ,
273283 parallel_tool_calls = parallel_tool_calls ,
274284 presence_penalty = presence_penalty ,
@@ -320,6 +330,7 @@ async def parse(
320330 * ,
321331 messages : Iterable [ChatCompletionMessageParam ],
322332 model : Union [str , ChatModel ],
333+ audio : Optional [ChatCompletionAudioParam ] | NotGiven = NOT_GIVEN ,
323334 response_format : type [ResponseFormatT ] | NotGiven = NOT_GIVEN ,
324335 frequency_penalty : Optional [float ] | NotGiven = NOT_GIVEN ,
325336 function_call : completion_create_params .FunctionCall | NotGiven = NOT_GIVEN ,
@@ -329,6 +340,7 @@ async def parse(
329340 max_completion_tokens : Optional [int ] | NotGiven = NOT_GIVEN ,
330341 max_tokens : Optional [int ] | NotGiven = NOT_GIVEN ,
331342 metadata : Optional [Dict [str , str ]] | NotGiven = NOT_GIVEN ,
343+ modalities : Optional [List [ChatCompletionModality ]] | NotGiven = NOT_GIVEN ,
332344 n : Optional [int ] | NotGiven = NOT_GIVEN ,
333345 parallel_tool_calls : bool | NotGiven = NOT_GIVEN ,
334346 presence_penalty : Optional [float ] | NotGiven = NOT_GIVEN ,
@@ -412,6 +424,7 @@ def parser(raw_completion: ChatCompletion) -> ParsedChatCompletion[ResponseForma
412424 {
413425 "messages" : messages ,
414426 "model" : model ,
427+ "audio" : audio ,
415428 "frequency_penalty" : frequency_penalty ,
416429 "function_call" : function_call ,
417430 "functions" : functions ,
@@ -420,6 +433,7 @@ def parser(raw_completion: ChatCompletion) -> ParsedChatCompletion[ResponseForma
420433 "max_completion_tokens" : max_completion_tokens ,
421434 "max_tokens" : max_tokens ,
422435 "metadata" : metadata ,
436+ "modalities" : modalities ,
423437 "n" : n ,
424438 "parallel_tool_calls" : parallel_tool_calls ,
425439 "presence_penalty" : presence_penalty ,
@@ -457,6 +471,7 @@ def stream(
457471 * ,
458472 messages : Iterable [ChatCompletionMessageParam ],
459473 model : Union [str , ChatModel ],
474+ audio : Optional [ChatCompletionAudioParam ] | NotGiven = NOT_GIVEN ,
460475 response_format : completion_create_params .ResponseFormat | type [ResponseFormatT ] | NotGiven = NOT_GIVEN ,
461476 frequency_penalty : Optional [float ] | NotGiven = NOT_GIVEN ,
462477 function_call : completion_create_params .FunctionCall | NotGiven = NOT_GIVEN ,
@@ -466,6 +481,7 @@ def stream(
466481 max_completion_tokens : Optional [int ] | NotGiven = NOT_GIVEN ,
467482 max_tokens : Optional [int ] | NotGiven = NOT_GIVEN ,
468483 metadata : Optional [Dict [str , str ]] | NotGiven = NOT_GIVEN ,
484+ modalities : Optional [List [ChatCompletionModality ]] | NotGiven = NOT_GIVEN ,
469485 n : Optional [int ] | NotGiven = NOT_GIVEN ,
470486 parallel_tool_calls : bool | NotGiven = NOT_GIVEN ,
471487 presence_penalty : Optional [float ] | NotGiven = NOT_GIVEN ,
@@ -519,6 +535,7 @@ def stream(
519535 api_request = self ._client .chat .completions .create (
520536 messages = messages ,
521537 model = model ,
538+ audio = audio ,
522539 stream = True ,
523540 response_format = _type_to_response_format (response_format ),
524541 frequency_penalty = frequency_penalty ,
@@ -529,6 +546,7 @@ def stream(
529546 max_completion_tokens = max_completion_tokens ,
530547 max_tokens = max_tokens ,
531548 metadata = metadata ,
549+ modalities = modalities ,
532550 n = n ,
533551 parallel_tool_calls = parallel_tool_calls ,
534552 presence_penalty = presence_penalty ,
0 commit comments