@@ -58,9 +58,11 @@ def create(
58
58
response_format : completion_create_params .ResponseFormat | NotGiven = NOT_GIVEN ,
59
59
stream : Literal [False ] | NotGiven = NOT_GIVEN ,
60
60
temperature : float | NotGiven = NOT_GIVEN ,
61
+ tool_choice : completion_create_params .ToolChoice | NotGiven = NOT_GIVEN ,
61
62
tools : Iterable [completion_create_params .Tool ] | NotGiven = NOT_GIVEN ,
62
63
top_k : int | NotGiven = NOT_GIVEN ,
63
64
top_p : float | NotGiven = NOT_GIVEN ,
65
+ user : str | NotGiven = NOT_GIVEN ,
64
66
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
65
67
# The extra values given here take precedence over values defined on the client or passed to this method.
66
68
extra_headers : Headers | None = None ,
@@ -92,13 +94,25 @@ def create(
92
94
to more creative responses. Lower values will make the response more focused and
93
95
deterministic.
94
96
97
+ tool_choice: Controls which (if any) tool is called by the model. `none` means the model will
98
+ not call any tool and instead generates a message. `auto` means the model can
99
+ pick between generating a message or calling one or more tools. `required` means
100
+ the model must call one or more tools. Specifying a particular tool via
101
+ `{"type": "function", "function": {"name": "my_function"}}` forces the model to
102
+ call that tool.
103
+
104
+ `none` is the default when no tools are present. `auto` is the default if tools
105
+ are present.
106
+
95
107
tools: List of tool definitions available to the model
96
108
97
109
top_k: Only sample from the top K options for each subsequent token.
98
110
99
111
top_p: Controls diversity of the response by setting a probability threshold when
100
112
choosing the next token.
101
113
114
+ user: A unique identifier representing your application end-user for monitoring abuse.
115
+
102
116
extra_headers: Send extra headers
103
117
104
118
extra_query: Add additional query parameters to the request
@@ -120,9 +134,11 @@ def create(
120
134
repetition_penalty : float | NotGiven = NOT_GIVEN ,
121
135
response_format : completion_create_params .ResponseFormat | NotGiven = NOT_GIVEN ,
122
136
temperature : float | NotGiven = NOT_GIVEN ,
137
+ tool_choice : completion_create_params .ToolChoice | NotGiven = NOT_GIVEN ,
123
138
tools : Iterable [completion_create_params .Tool ] | NotGiven = NOT_GIVEN ,
124
139
top_k : int | NotGiven = NOT_GIVEN ,
125
140
top_p : float | NotGiven = NOT_GIVEN ,
141
+ user : str | NotGiven = NOT_GIVEN ,
126
142
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
127
143
# The extra values given here take precedence over values defined on the client or passed to this method.
128
144
extra_headers : Headers | None = None ,
@@ -154,13 +170,25 @@ def create(
154
170
to more creative responses. Lower values will make the response more focused and
155
171
deterministic.
156
172
173
+ tool_choice: Controls which (if any) tool is called by the model. `none` means the model will
174
+ not call any tool and instead generates a message. `auto` means the model can
175
+ pick between generating a message or calling one or more tools. `required` means
176
+ the model must call one or more tools. Specifying a particular tool via
177
+ `{"type": "function", "function": {"name": "my_function"}}` forces the model to
178
+ call that tool.
179
+
180
+ `none` is the default when no tools are present. `auto` is the default if tools
181
+ are present.
182
+
157
183
tools: List of tool definitions available to the model
158
184
159
185
top_k: Only sample from the top K options for each subsequent token.
160
186
161
187
top_p: Controls diversity of the response by setting a probability threshold when
162
188
choosing the next token.
163
189
190
+ user: A unique identifier representing your application end-user for monitoring abuse.
191
+
164
192
extra_headers: Send extra headers
165
193
166
194
extra_query: Add additional query parameters to the request
@@ -182,9 +210,11 @@ def create(
182
210
repetition_penalty : float | NotGiven = NOT_GIVEN ,
183
211
response_format : completion_create_params .ResponseFormat | NotGiven = NOT_GIVEN ,
184
212
temperature : float | NotGiven = NOT_GIVEN ,
213
+ tool_choice : completion_create_params .ToolChoice | NotGiven = NOT_GIVEN ,
185
214
tools : Iterable [completion_create_params .Tool ] | NotGiven = NOT_GIVEN ,
186
215
top_k : int | NotGiven = NOT_GIVEN ,
187
216
top_p : float | NotGiven = NOT_GIVEN ,
217
+ user : str | NotGiven = NOT_GIVEN ,
188
218
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
189
219
# The extra values given here take precedence over values defined on the client or passed to this method.
190
220
extra_headers : Headers | None = None ,
@@ -216,13 +246,25 @@ def create(
216
246
to more creative responses. Lower values will make the response more focused and
217
247
deterministic.
218
248
249
+ tool_choice: Controls which (if any) tool is called by the model. `none` means the model will
250
+ not call any tool and instead generates a message. `auto` means the model can
251
+ pick between generating a message or calling one or more tools. `required` means
252
+ the model must call one or more tools. Specifying a particular tool via
253
+ `{"type": "function", "function": {"name": "my_function"}}` forces the model to
254
+ call that tool.
255
+
256
+ `none` is the default when no tools are present. `auto` is the default if tools
257
+ are present.
258
+
219
259
tools: List of tool definitions available to the model
220
260
221
261
top_k: Only sample from the top K options for each subsequent token.
222
262
223
263
top_p: Controls diversity of the response by setting a probability threshold when
224
264
choosing the next token.
225
265
266
+ user: A unique identifier representing your application end-user for monitoring abuse.
267
+
226
268
extra_headers: Send extra headers
227
269
228
270
extra_query: Add additional query parameters to the request
@@ -244,9 +286,11 @@ def create(
244
286
response_format : completion_create_params .ResponseFormat | NotGiven = NOT_GIVEN ,
245
287
stream : Literal [False ] | Literal [True ] | NotGiven = NOT_GIVEN ,
246
288
temperature : float | NotGiven = NOT_GIVEN ,
289
+ tool_choice : completion_create_params .ToolChoice | NotGiven = NOT_GIVEN ,
247
290
tools : Iterable [completion_create_params .Tool ] | NotGiven = NOT_GIVEN ,
248
291
top_k : int | NotGiven = NOT_GIVEN ,
249
292
top_p : float | NotGiven = NOT_GIVEN ,
293
+ user : str | NotGiven = NOT_GIVEN ,
250
294
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
251
295
# The extra values given here take precedence over values defined on the client or passed to this method.
252
296
extra_headers : Headers | None = None ,
@@ -267,9 +311,11 @@ def create(
267
311
"response_format" : response_format ,
268
312
"stream" : stream ,
269
313
"temperature" : temperature ,
314
+ "tool_choice" : tool_choice ,
270
315
"tools" : tools ,
271
316
"top_k" : top_k ,
272
317
"top_p" : top_p ,
318
+ "user" : user ,
273
319
},
274
320
completion_create_params .CompletionCreateParamsStreaming
275
321
if stream
@@ -315,9 +361,11 @@ async def create(
315
361
response_format : completion_create_params .ResponseFormat | NotGiven = NOT_GIVEN ,
316
362
stream : Literal [False ] | NotGiven = NOT_GIVEN ,
317
363
temperature : float | NotGiven = NOT_GIVEN ,
364
+ tool_choice : completion_create_params .ToolChoice | NotGiven = NOT_GIVEN ,
318
365
tools : Iterable [completion_create_params .Tool ] | NotGiven = NOT_GIVEN ,
319
366
top_k : int | NotGiven = NOT_GIVEN ,
320
367
top_p : float | NotGiven = NOT_GIVEN ,
368
+ user : str | NotGiven = NOT_GIVEN ,
321
369
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
322
370
# The extra values given here take precedence over values defined on the client or passed to this method.
323
371
extra_headers : Headers | None = None ,
@@ -349,13 +397,25 @@ async def create(
349
397
to more creative responses. Lower values will make the response more focused and
350
398
deterministic.
351
399
400
+ tool_choice: Controls which (if any) tool is called by the model. `none` means the model will
401
+ not call any tool and instead generates a message. `auto` means the model can
402
+ pick between generating a message or calling one or more tools. `required` means
403
+ the model must call one or more tools. Specifying a particular tool via
404
+ `{"type": "function", "function": {"name": "my_function"}}` forces the model to
405
+ call that tool.
406
+
407
+ `none` is the default when no tools are present. `auto` is the default if tools
408
+ are present.
409
+
352
410
tools: List of tool definitions available to the model
353
411
354
412
top_k: Only sample from the top K options for each subsequent token.
355
413
356
414
top_p: Controls diversity of the response by setting a probability threshold when
357
415
choosing the next token.
358
416
417
+ user: A unique identifier representing your application end-user for monitoring abuse.
418
+
359
419
extra_headers: Send extra headers
360
420
361
421
extra_query: Add additional query parameters to the request
@@ -377,9 +437,11 @@ async def create(
377
437
repetition_penalty : float | NotGiven = NOT_GIVEN ,
378
438
response_format : completion_create_params .ResponseFormat | NotGiven = NOT_GIVEN ,
379
439
temperature : float | NotGiven = NOT_GIVEN ,
440
+ tool_choice : completion_create_params .ToolChoice | NotGiven = NOT_GIVEN ,
380
441
tools : Iterable [completion_create_params .Tool ] | NotGiven = NOT_GIVEN ,
381
442
top_k : int | NotGiven = NOT_GIVEN ,
382
443
top_p : float | NotGiven = NOT_GIVEN ,
444
+ user : str | NotGiven = NOT_GIVEN ,
383
445
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
384
446
# The extra values given here take precedence over values defined on the client or passed to this method.
385
447
extra_headers : Headers | None = None ,
@@ -411,13 +473,25 @@ async def create(
411
473
to more creative responses. Lower values will make the response more focused and
412
474
deterministic.
413
475
476
+ tool_choice: Controls which (if any) tool is called by the model. `none` means the model will
477
+ not call any tool and instead generates a message. `auto` means the model can
478
+ pick between generating a message or calling one or more tools. `required` means
479
+ the model must call one or more tools. Specifying a particular tool via
480
+ `{"type": "function", "function": {"name": "my_function"}}` forces the model to
481
+ call that tool.
482
+
483
+ `none` is the default when no tools are present. `auto` is the default if tools
484
+ are present.
485
+
414
486
tools: List of tool definitions available to the model
415
487
416
488
top_k: Only sample from the top K options for each subsequent token.
417
489
418
490
top_p: Controls diversity of the response by setting a probability threshold when
419
491
choosing the next token.
420
492
493
+ user: A unique identifier representing your application end-user for monitoring abuse.
494
+
421
495
extra_headers: Send extra headers
422
496
423
497
extra_query: Add additional query parameters to the request
@@ -439,9 +513,11 @@ async def create(
439
513
repetition_penalty : float | NotGiven = NOT_GIVEN ,
440
514
response_format : completion_create_params .ResponseFormat | NotGiven = NOT_GIVEN ,
441
515
temperature : float | NotGiven = NOT_GIVEN ,
516
+ tool_choice : completion_create_params .ToolChoice | NotGiven = NOT_GIVEN ,
442
517
tools : Iterable [completion_create_params .Tool ] | NotGiven = NOT_GIVEN ,
443
518
top_k : int | NotGiven = NOT_GIVEN ,
444
519
top_p : float | NotGiven = NOT_GIVEN ,
520
+ user : str | NotGiven = NOT_GIVEN ,
445
521
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
446
522
# The extra values given here take precedence over values defined on the client or passed to this method.
447
523
extra_headers : Headers | None = None ,
@@ -473,13 +549,25 @@ async def create(
473
549
to more creative responses. Lower values will make the response more focused and
474
550
deterministic.
475
551
552
+ tool_choice: Controls which (if any) tool is called by the model. `none` means the model will
553
+ not call any tool and instead generates a message. `auto` means the model can
554
+ pick between generating a message or calling one or more tools. `required` means
555
+ the model must call one or more tools. Specifying a particular tool via
556
+ `{"type": "function", "function": {"name": "my_function"}}` forces the model to
557
+ call that tool.
558
+
559
+ `none` is the default when no tools are present. `auto` is the default if tools
560
+ are present.
561
+
476
562
tools: List of tool definitions available to the model
477
563
478
564
top_k: Only sample from the top K options for each subsequent token.
479
565
480
566
top_p: Controls diversity of the response by setting a probability threshold when
481
567
choosing the next token.
482
568
569
+ user: A unique identifier representing your application end-user for monitoring abuse.
570
+
483
571
extra_headers: Send extra headers
484
572
485
573
extra_query: Add additional query parameters to the request
@@ -501,9 +589,11 @@ async def create(
501
589
response_format : completion_create_params .ResponseFormat | NotGiven = NOT_GIVEN ,
502
590
stream : Literal [False ] | Literal [True ] | NotGiven = NOT_GIVEN ,
503
591
temperature : float | NotGiven = NOT_GIVEN ,
592
+ tool_choice : completion_create_params .ToolChoice | NotGiven = NOT_GIVEN ,
504
593
tools : Iterable [completion_create_params .Tool ] | NotGiven = NOT_GIVEN ,
505
594
top_k : int | NotGiven = NOT_GIVEN ,
506
595
top_p : float | NotGiven = NOT_GIVEN ,
596
+ user : str | NotGiven = NOT_GIVEN ,
507
597
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
508
598
# The extra values given here take precedence over values defined on the client or passed to this method.
509
599
extra_headers : Headers | None = None ,
@@ -524,9 +614,11 @@ async def create(
524
614
"response_format" : response_format ,
525
615
"stream" : stream ,
526
616
"temperature" : temperature ,
617
+ "tool_choice" : tool_choice ,
527
618
"tools" : tools ,
528
619
"top_k" : top_k ,
529
620
"top_p" : top_p ,
621
+ "user" : user ,
530
622
},
531
623
completion_create_params .CompletionCreateParamsStreaming
532
624
if stream
0 commit comments