@@ -58,9 +58,11 @@ def create(
5858 response_format : completion_create_params .ResponseFormat | NotGiven = NOT_GIVEN ,
5959 stream : Literal [False ] | NotGiven = NOT_GIVEN ,
6060 temperature : float | NotGiven = NOT_GIVEN ,
61+ tool_choice : completion_create_params .ToolChoice | NotGiven = NOT_GIVEN ,
6162 tools : Iterable [completion_create_params .Tool ] | NotGiven = NOT_GIVEN ,
6263 top_k : int | NotGiven = NOT_GIVEN ,
6364 top_p : float | NotGiven = NOT_GIVEN ,
65+ user : str | NotGiven = NOT_GIVEN ,
6466 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
6567 # The extra values given here take precedence over values defined on the client or passed to this method.
6668 extra_headers : Headers | None = None ,
@@ -92,13 +94,25 @@ def create(
9294 to more creative responses. Lower values will make the response more focused and
9395 deterministic.
9496
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+
95107 tools: List of tool definitions available to the model
96108
97109 top_k: Only sample from the top K options for each subsequent token.
98110
99111 top_p: Controls diversity of the response by setting a probability threshold when
100112 choosing the next token.
101113
114+ user: A unique identifier representing your application end-user for monitoring abuse.
115+
102116 extra_headers: Send extra headers
103117
104118 extra_query: Add additional query parameters to the request
@@ -120,9 +134,11 @@ def create(
120134 repetition_penalty : float | NotGiven = NOT_GIVEN ,
121135 response_format : completion_create_params .ResponseFormat | NotGiven = NOT_GIVEN ,
122136 temperature : float | NotGiven = NOT_GIVEN ,
137+ tool_choice : completion_create_params .ToolChoice | NotGiven = NOT_GIVEN ,
123138 tools : Iterable [completion_create_params .Tool ] | NotGiven = NOT_GIVEN ,
124139 top_k : int | NotGiven = NOT_GIVEN ,
125140 top_p : float | NotGiven = NOT_GIVEN ,
141+ user : str | NotGiven = NOT_GIVEN ,
126142 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
127143 # The extra values given here take precedence over values defined on the client or passed to this method.
128144 extra_headers : Headers | None = None ,
@@ -154,13 +170,25 @@ def create(
154170 to more creative responses. Lower values will make the response more focused and
155171 deterministic.
156172
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+
157183 tools: List of tool definitions available to the model
158184
159185 top_k: Only sample from the top K options for each subsequent token.
160186
161187 top_p: Controls diversity of the response by setting a probability threshold when
162188 choosing the next token.
163189
190+ user: A unique identifier representing your application end-user for monitoring abuse.
191+
164192 extra_headers: Send extra headers
165193
166194 extra_query: Add additional query parameters to the request
@@ -182,9 +210,11 @@ def create(
182210 repetition_penalty : float | NotGiven = NOT_GIVEN ,
183211 response_format : completion_create_params .ResponseFormat | NotGiven = NOT_GIVEN ,
184212 temperature : float | NotGiven = NOT_GIVEN ,
213+ tool_choice : completion_create_params .ToolChoice | NotGiven = NOT_GIVEN ,
185214 tools : Iterable [completion_create_params .Tool ] | NotGiven = NOT_GIVEN ,
186215 top_k : int | NotGiven = NOT_GIVEN ,
187216 top_p : float | NotGiven = NOT_GIVEN ,
217+ user : str | NotGiven = NOT_GIVEN ,
188218 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
189219 # The extra values given here take precedence over values defined on the client or passed to this method.
190220 extra_headers : Headers | None = None ,
@@ -216,13 +246,25 @@ def create(
216246 to more creative responses. Lower values will make the response more focused and
217247 deterministic.
218248
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+
219259 tools: List of tool definitions available to the model
220260
221261 top_k: Only sample from the top K options for each subsequent token.
222262
223263 top_p: Controls diversity of the response by setting a probability threshold when
224264 choosing the next token.
225265
266+ user: A unique identifier representing your application end-user for monitoring abuse.
267+
226268 extra_headers: Send extra headers
227269
228270 extra_query: Add additional query parameters to the request
@@ -244,9 +286,11 @@ def create(
244286 response_format : completion_create_params .ResponseFormat | NotGiven = NOT_GIVEN ,
245287 stream : Literal [False ] | Literal [True ] | NotGiven = NOT_GIVEN ,
246288 temperature : float | NotGiven = NOT_GIVEN ,
289+ tool_choice : completion_create_params .ToolChoice | NotGiven = NOT_GIVEN ,
247290 tools : Iterable [completion_create_params .Tool ] | NotGiven = NOT_GIVEN ,
248291 top_k : int | NotGiven = NOT_GIVEN ,
249292 top_p : float | NotGiven = NOT_GIVEN ,
293+ user : str | NotGiven = NOT_GIVEN ,
250294 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
251295 # The extra values given here take precedence over values defined on the client or passed to this method.
252296 extra_headers : Headers | None = None ,
@@ -267,9 +311,11 @@ def create(
267311 "response_format" : response_format ,
268312 "stream" : stream ,
269313 "temperature" : temperature ,
314+ "tool_choice" : tool_choice ,
270315 "tools" : tools ,
271316 "top_k" : top_k ,
272317 "top_p" : top_p ,
318+ "user" : user ,
273319 },
274320 completion_create_params .CompletionCreateParamsStreaming
275321 if stream
@@ -315,9 +361,11 @@ async def create(
315361 response_format : completion_create_params .ResponseFormat | NotGiven = NOT_GIVEN ,
316362 stream : Literal [False ] | NotGiven = NOT_GIVEN ,
317363 temperature : float | NotGiven = NOT_GIVEN ,
364+ tool_choice : completion_create_params .ToolChoice | NotGiven = NOT_GIVEN ,
318365 tools : Iterable [completion_create_params .Tool ] | NotGiven = NOT_GIVEN ,
319366 top_k : int | NotGiven = NOT_GIVEN ,
320367 top_p : float | NotGiven = NOT_GIVEN ,
368+ user : str | NotGiven = NOT_GIVEN ,
321369 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
322370 # The extra values given here take precedence over values defined on the client or passed to this method.
323371 extra_headers : Headers | None = None ,
@@ -349,13 +397,25 @@ async def create(
349397 to more creative responses. Lower values will make the response more focused and
350398 deterministic.
351399
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+
352410 tools: List of tool definitions available to the model
353411
354412 top_k: Only sample from the top K options for each subsequent token.
355413
356414 top_p: Controls diversity of the response by setting a probability threshold when
357415 choosing the next token.
358416
417+ user: A unique identifier representing your application end-user for monitoring abuse.
418+
359419 extra_headers: Send extra headers
360420
361421 extra_query: Add additional query parameters to the request
@@ -377,9 +437,11 @@ async def create(
377437 repetition_penalty : float | NotGiven = NOT_GIVEN ,
378438 response_format : completion_create_params .ResponseFormat | NotGiven = NOT_GIVEN ,
379439 temperature : float | NotGiven = NOT_GIVEN ,
440+ tool_choice : completion_create_params .ToolChoice | NotGiven = NOT_GIVEN ,
380441 tools : Iterable [completion_create_params .Tool ] | NotGiven = NOT_GIVEN ,
381442 top_k : int | NotGiven = NOT_GIVEN ,
382443 top_p : float | NotGiven = NOT_GIVEN ,
444+ user : str | NotGiven = NOT_GIVEN ,
383445 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
384446 # The extra values given here take precedence over values defined on the client or passed to this method.
385447 extra_headers : Headers | None = None ,
@@ -411,13 +473,25 @@ async def create(
411473 to more creative responses. Lower values will make the response more focused and
412474 deterministic.
413475
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+
414486 tools: List of tool definitions available to the model
415487
416488 top_k: Only sample from the top K options for each subsequent token.
417489
418490 top_p: Controls diversity of the response by setting a probability threshold when
419491 choosing the next token.
420492
493+ user: A unique identifier representing your application end-user for monitoring abuse.
494+
421495 extra_headers: Send extra headers
422496
423497 extra_query: Add additional query parameters to the request
@@ -439,9 +513,11 @@ async def create(
439513 repetition_penalty : float | NotGiven = NOT_GIVEN ,
440514 response_format : completion_create_params .ResponseFormat | NotGiven = NOT_GIVEN ,
441515 temperature : float | NotGiven = NOT_GIVEN ,
516+ tool_choice : completion_create_params .ToolChoice | NotGiven = NOT_GIVEN ,
442517 tools : Iterable [completion_create_params .Tool ] | NotGiven = NOT_GIVEN ,
443518 top_k : int | NotGiven = NOT_GIVEN ,
444519 top_p : float | NotGiven = NOT_GIVEN ,
520+ user : str | NotGiven = NOT_GIVEN ,
445521 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
446522 # The extra values given here take precedence over values defined on the client or passed to this method.
447523 extra_headers : Headers | None = None ,
@@ -473,13 +549,25 @@ async def create(
473549 to more creative responses. Lower values will make the response more focused and
474550 deterministic.
475551
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+
476562 tools: List of tool definitions available to the model
477563
478564 top_k: Only sample from the top K options for each subsequent token.
479565
480566 top_p: Controls diversity of the response by setting a probability threshold when
481567 choosing the next token.
482568
569+ user: A unique identifier representing your application end-user for monitoring abuse.
570+
483571 extra_headers: Send extra headers
484572
485573 extra_query: Add additional query parameters to the request
@@ -501,9 +589,11 @@ async def create(
501589 response_format : completion_create_params .ResponseFormat | NotGiven = NOT_GIVEN ,
502590 stream : Literal [False ] | Literal [True ] | NotGiven = NOT_GIVEN ,
503591 temperature : float | NotGiven = NOT_GIVEN ,
592+ tool_choice : completion_create_params .ToolChoice | NotGiven = NOT_GIVEN ,
504593 tools : Iterable [completion_create_params .Tool ] | NotGiven = NOT_GIVEN ,
505594 top_k : int | NotGiven = NOT_GIVEN ,
506595 top_p : float | NotGiven = NOT_GIVEN ,
596+ user : str | NotGiven = NOT_GIVEN ,
507597 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
508598 # The extra values given here take precedence over values defined on the client or passed to this method.
509599 extra_headers : Headers | None = None ,
@@ -524,9 +614,11 @@ async def create(
524614 "response_format" : response_format ,
525615 "stream" : stream ,
526616 "temperature" : temperature ,
617+ "tool_choice" : tool_choice ,
527618 "tools" : tools ,
528619 "top_k" : top_k ,
529620 "top_p" : top_p ,
621+ "user" : user ,
530622 },
531623 completion_create_params .CompletionCreateParamsStreaming
532624 if stream
0 commit comments