28
28
from ....types .chat .chat_completion import ChatCompletion
29
29
from ....types .chat .chat_completion_chunk import ChatCompletionChunk
30
30
from ....types .chat .parsed_chat_completion import ParsedChatCompletion
31
+ from ....types .chat .chat_completion_modality import ChatCompletionModality
31
32
from ....types .chat .chat_completion_tool_param import ChatCompletionToolParam
33
+ from ....types .chat .chat_completion_audio_param import ChatCompletionAudioParam
32
34
from ....types .chat .chat_completion_message_param import ChatCompletionMessageParam
33
35
from ....types .chat .chat_completion_stream_options_param import ChatCompletionStreamOptionsParam
34
36
from ....types .chat .chat_completion_tool_choice_option_param import ChatCompletionToolChoiceOptionParam
@@ -61,6 +63,7 @@ def parse(
61
63
* ,
62
64
messages : Iterable [ChatCompletionMessageParam ],
63
65
model : Union [str , ChatModel ],
66
+ audio : Optional [ChatCompletionAudioParam ] | NotGiven = NOT_GIVEN ,
64
67
response_format : type [ResponseFormatT ] | NotGiven = NOT_GIVEN ,
65
68
frequency_penalty : Optional [float ] | NotGiven = NOT_GIVEN ,
66
69
function_call : completion_create_params .FunctionCall | NotGiven = NOT_GIVEN ,
@@ -70,6 +73,7 @@ def parse(
70
73
max_completion_tokens : Optional [int ] | NotGiven = NOT_GIVEN ,
71
74
max_tokens : Optional [int ] | NotGiven = NOT_GIVEN ,
72
75
metadata : Optional [Dict [str , str ]] | NotGiven = NOT_GIVEN ,
76
+ modalities : Optional [List [ChatCompletionModality ]] | NotGiven = NOT_GIVEN ,
73
77
n : Optional [int ] | NotGiven = NOT_GIVEN ,
74
78
parallel_tool_calls : bool | NotGiven = NOT_GIVEN ,
75
79
presence_penalty : Optional [float ] | NotGiven = NOT_GIVEN ,
@@ -153,6 +157,7 @@ def parser(raw_completion: ChatCompletion) -> ParsedChatCompletion[ResponseForma
153
157
{
154
158
"messages" : messages ,
155
159
"model" : model ,
160
+ "audio" : audio ,
156
161
"frequency_penalty" : frequency_penalty ,
157
162
"function_call" : function_call ,
158
163
"functions" : functions ,
@@ -161,6 +166,7 @@ def parser(raw_completion: ChatCompletion) -> ParsedChatCompletion[ResponseForma
161
166
"max_completion_tokens" : max_completion_tokens ,
162
167
"max_tokens" : max_tokens ,
163
168
"metadata" : metadata ,
169
+ "modalities" : modalities ,
164
170
"n" : n ,
165
171
"parallel_tool_calls" : parallel_tool_calls ,
166
172
"presence_penalty" : presence_penalty ,
@@ -198,6 +204,7 @@ def stream(
198
204
* ,
199
205
messages : Iterable [ChatCompletionMessageParam ],
200
206
model : Union [str , ChatModel ],
207
+ audio : Optional [ChatCompletionAudioParam ] | NotGiven = NOT_GIVEN ,
201
208
response_format : completion_create_params .ResponseFormat | type [ResponseFormatT ] | NotGiven = NOT_GIVEN ,
202
209
frequency_penalty : Optional [float ] | NotGiven = NOT_GIVEN ,
203
210
function_call : completion_create_params .FunctionCall | NotGiven = NOT_GIVEN ,
@@ -207,6 +214,7 @@ def stream(
207
214
max_completion_tokens : Optional [int ] | NotGiven = NOT_GIVEN ,
208
215
max_tokens : Optional [int ] | NotGiven = NOT_GIVEN ,
209
216
metadata : Optional [Dict [str , str ]] | NotGiven = NOT_GIVEN ,
217
+ modalities : Optional [List [ChatCompletionModality ]] | NotGiven = NOT_GIVEN ,
210
218
n : Optional [int ] | NotGiven = NOT_GIVEN ,
211
219
parallel_tool_calls : bool | NotGiven = NOT_GIVEN ,
212
220
presence_penalty : Optional [float ] | NotGiven = NOT_GIVEN ,
@@ -259,6 +267,7 @@ def stream(
259
267
self ._client .chat .completions .create ,
260
268
messages = messages ,
261
269
model = model ,
270
+ audio = audio ,
262
271
stream = True ,
263
272
response_format = _type_to_response_format (response_format ),
264
273
frequency_penalty = frequency_penalty ,
@@ -269,6 +278,7 @@ def stream(
269
278
max_completion_tokens = max_completion_tokens ,
270
279
max_tokens = max_tokens ,
271
280
metadata = metadata ,
281
+ modalities = modalities ,
272
282
n = n ,
273
283
parallel_tool_calls = parallel_tool_calls ,
274
284
presence_penalty = presence_penalty ,
@@ -320,6 +330,7 @@ async def parse(
320
330
* ,
321
331
messages : Iterable [ChatCompletionMessageParam ],
322
332
model : Union [str , ChatModel ],
333
+ audio : Optional [ChatCompletionAudioParam ] | NotGiven = NOT_GIVEN ,
323
334
response_format : type [ResponseFormatT ] | NotGiven = NOT_GIVEN ,
324
335
frequency_penalty : Optional [float ] | NotGiven = NOT_GIVEN ,
325
336
function_call : completion_create_params .FunctionCall | NotGiven = NOT_GIVEN ,
@@ -329,6 +340,7 @@ async def parse(
329
340
max_completion_tokens : Optional [int ] | NotGiven = NOT_GIVEN ,
330
341
max_tokens : Optional [int ] | NotGiven = NOT_GIVEN ,
331
342
metadata : Optional [Dict [str , str ]] | NotGiven = NOT_GIVEN ,
343
+ modalities : Optional [List [ChatCompletionModality ]] | NotGiven = NOT_GIVEN ,
332
344
n : Optional [int ] | NotGiven = NOT_GIVEN ,
333
345
parallel_tool_calls : bool | NotGiven = NOT_GIVEN ,
334
346
presence_penalty : Optional [float ] | NotGiven = NOT_GIVEN ,
@@ -412,6 +424,7 @@ def parser(raw_completion: ChatCompletion) -> ParsedChatCompletion[ResponseForma
412
424
{
413
425
"messages" : messages ,
414
426
"model" : model ,
427
+ "audio" : audio ,
415
428
"frequency_penalty" : frequency_penalty ,
416
429
"function_call" : function_call ,
417
430
"functions" : functions ,
@@ -420,6 +433,7 @@ def parser(raw_completion: ChatCompletion) -> ParsedChatCompletion[ResponseForma
420
433
"max_completion_tokens" : max_completion_tokens ,
421
434
"max_tokens" : max_tokens ,
422
435
"metadata" : metadata ,
436
+ "modalities" : modalities ,
423
437
"n" : n ,
424
438
"parallel_tool_calls" : parallel_tool_calls ,
425
439
"presence_penalty" : presence_penalty ,
@@ -457,6 +471,7 @@ def stream(
457
471
* ,
458
472
messages : Iterable [ChatCompletionMessageParam ],
459
473
model : Union [str , ChatModel ],
474
+ audio : Optional [ChatCompletionAudioParam ] | NotGiven = NOT_GIVEN ,
460
475
response_format : completion_create_params .ResponseFormat | type [ResponseFormatT ] | NotGiven = NOT_GIVEN ,
461
476
frequency_penalty : Optional [float ] | NotGiven = NOT_GIVEN ,
462
477
function_call : completion_create_params .FunctionCall | NotGiven = NOT_GIVEN ,
@@ -466,6 +481,7 @@ def stream(
466
481
max_completion_tokens : Optional [int ] | NotGiven = NOT_GIVEN ,
467
482
max_tokens : Optional [int ] | NotGiven = NOT_GIVEN ,
468
483
metadata : Optional [Dict [str , str ]] | NotGiven = NOT_GIVEN ,
484
+ modalities : Optional [List [ChatCompletionModality ]] | NotGiven = NOT_GIVEN ,
469
485
n : Optional [int ] | NotGiven = NOT_GIVEN ,
470
486
parallel_tool_calls : bool | NotGiven = NOT_GIVEN ,
471
487
presence_penalty : Optional [float ] | NotGiven = NOT_GIVEN ,
@@ -519,6 +535,7 @@ def stream(
519
535
api_request = self ._client .chat .completions .create (
520
536
messages = messages ,
521
537
model = model ,
538
+ audio = audio ,
522
539
stream = True ,
523
540
response_format = _type_to_response_format (response_format ),
524
541
frequency_penalty = frequency_penalty ,
@@ -529,6 +546,7 @@ def stream(
529
546
max_completion_tokens = max_completion_tokens ,
530
547
max_tokens = max_tokens ,
531
548
metadata = metadata ,
549
+ modalities = modalities ,
532
550
n = n ,
533
551
parallel_tool_calls = parallel_tool_calls ,
534
552
presence_penalty = presence_penalty ,
0 commit comments