Skip to content

Commit 79b7675

Browse files
feat(api): updates (#1146)
1 parent 7f9e850 commit 79b7675

File tree

3 files changed

+38
-0
lines changed

3 files changed

+38
-0
lines changed

src/openai/resources/chat/completions.py

+28
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ def create(
6868
frequency_penalty: Optional[float] | NotGiven = NOT_GIVEN,
6969
function_call: completion_create_params.FunctionCall | NotGiven = NOT_GIVEN,
7070
functions: Iterable[completion_create_params.Function] | NotGiven = NOT_GIVEN,
71+
instance_id: Optional[str] | NotGiven = NOT_GIVEN,
7172
logit_bias: Optional[Dict[str, int]] | NotGiven = NOT_GIVEN,
7273
logprobs: Optional[bool] | NotGiven = NOT_GIVEN,
7374
max_tokens: Optional[int] | NotGiven = NOT_GIVEN,
@@ -122,6 +123,9 @@ def create(
122123
123124
A list of functions the model may generate JSON inputs for.
124125
126+
instance_id: An unique identifier to a custom instance to execute the request. The requesting
127+
organization is required to have access to the instance.
128+
125129
logit_bias: Modify the likelihood of specified tokens appearing in the completion.
126130
127131
Accepts a JSON object that maps tokens (specified by their token ID in the
@@ -259,6 +263,7 @@ def create(
259263
frequency_penalty: Optional[float] | NotGiven = NOT_GIVEN,
260264
function_call: completion_create_params.FunctionCall | NotGiven = NOT_GIVEN,
261265
functions: Iterable[completion_create_params.Function] | NotGiven = NOT_GIVEN,
266+
instance_id: Optional[str] | NotGiven = NOT_GIVEN,
262267
logit_bias: Optional[Dict[str, int]] | NotGiven = NOT_GIVEN,
263268
logprobs: Optional[bool] | NotGiven = NOT_GIVEN,
264269
max_tokens: Optional[int] | NotGiven = NOT_GIVEN,
@@ -319,6 +324,9 @@ def create(
319324
320325
A list of functions the model may generate JSON inputs for.
321326
327+
instance_id: An unique identifier to a custom instance to execute the request. The requesting
328+
organization is required to have access to the instance.
329+
322330
logit_bias: Modify the likelihood of specified tokens appearing in the completion.
323331
324332
Accepts a JSON object that maps tokens (specified by their token ID in the
@@ -449,6 +457,7 @@ def create(
449457
frequency_penalty: Optional[float] | NotGiven = NOT_GIVEN,
450458
function_call: completion_create_params.FunctionCall | NotGiven = NOT_GIVEN,
451459
functions: Iterable[completion_create_params.Function] | NotGiven = NOT_GIVEN,
460+
instance_id: Optional[str] | NotGiven = NOT_GIVEN,
452461
logit_bias: Optional[Dict[str, int]] | NotGiven = NOT_GIVEN,
453462
logprobs: Optional[bool] | NotGiven = NOT_GIVEN,
454463
max_tokens: Optional[int] | NotGiven = NOT_GIVEN,
@@ -509,6 +518,9 @@ def create(
509518
510519
A list of functions the model may generate JSON inputs for.
511520
521+
instance_id: An unique identifier to a custom instance to execute the request. The requesting
522+
organization is required to have access to the instance.
523+
512524
logit_bias: Modify the likelihood of specified tokens appearing in the completion.
513525
514526
Accepts a JSON object that maps tokens (specified by their token ID in the
@@ -638,6 +650,7 @@ def create(
638650
frequency_penalty: Optional[float] | NotGiven = NOT_GIVEN,
639651
function_call: completion_create_params.FunctionCall | NotGiven = NOT_GIVEN,
640652
functions: Iterable[completion_create_params.Function] | NotGiven = NOT_GIVEN,
653+
instance_id: Optional[str] | NotGiven = NOT_GIVEN,
641654
logit_bias: Optional[Dict[str, int]] | NotGiven = NOT_GIVEN,
642655
logprobs: Optional[bool] | NotGiven = NOT_GIVEN,
643656
max_tokens: Optional[int] | NotGiven = NOT_GIVEN,
@@ -669,6 +682,7 @@ def create(
669682
"frequency_penalty": frequency_penalty,
670683
"function_call": function_call,
671684
"functions": functions,
685+
"instance_id": instance_id,
672686
"logit_bias": logit_bias,
673687
"logprobs": logprobs,
674688
"max_tokens": max_tokens,
@@ -735,6 +749,7 @@ async def create(
735749
frequency_penalty: Optional[float] | NotGiven = NOT_GIVEN,
736750
function_call: completion_create_params.FunctionCall | NotGiven = NOT_GIVEN,
737751
functions: Iterable[completion_create_params.Function] | NotGiven = NOT_GIVEN,
752+
instance_id: Optional[str] | NotGiven = NOT_GIVEN,
738753
logit_bias: Optional[Dict[str, int]] | NotGiven = NOT_GIVEN,
739754
logprobs: Optional[bool] | NotGiven = NOT_GIVEN,
740755
max_tokens: Optional[int] | NotGiven = NOT_GIVEN,
@@ -789,6 +804,9 @@ async def create(
789804
790805
A list of functions the model may generate JSON inputs for.
791806
807+
instance_id: An unique identifier to a custom instance to execute the request. The requesting
808+
organization is required to have access to the instance.
809+
792810
logit_bias: Modify the likelihood of specified tokens appearing in the completion.
793811
794812
Accepts a JSON object that maps tokens (specified by their token ID in the
@@ -926,6 +944,7 @@ async def create(
926944
frequency_penalty: Optional[float] | NotGiven = NOT_GIVEN,
927945
function_call: completion_create_params.FunctionCall | NotGiven = NOT_GIVEN,
928946
functions: Iterable[completion_create_params.Function] | NotGiven = NOT_GIVEN,
947+
instance_id: Optional[str] | NotGiven = NOT_GIVEN,
929948
logit_bias: Optional[Dict[str, int]] | NotGiven = NOT_GIVEN,
930949
logprobs: Optional[bool] | NotGiven = NOT_GIVEN,
931950
max_tokens: Optional[int] | NotGiven = NOT_GIVEN,
@@ -986,6 +1005,9 @@ async def create(
9861005
9871006
A list of functions the model may generate JSON inputs for.
9881007
1008+
instance_id: An unique identifier to a custom instance to execute the request. The requesting
1009+
organization is required to have access to the instance.
1010+
9891011
logit_bias: Modify the likelihood of specified tokens appearing in the completion.
9901012
9911013
Accepts a JSON object that maps tokens (specified by their token ID in the
@@ -1116,6 +1138,7 @@ async def create(
11161138
frequency_penalty: Optional[float] | NotGiven = NOT_GIVEN,
11171139
function_call: completion_create_params.FunctionCall | NotGiven = NOT_GIVEN,
11181140
functions: Iterable[completion_create_params.Function] | NotGiven = NOT_GIVEN,
1141+
instance_id: Optional[str] | NotGiven = NOT_GIVEN,
11191142
logit_bias: Optional[Dict[str, int]] | NotGiven = NOT_GIVEN,
11201143
logprobs: Optional[bool] | NotGiven = NOT_GIVEN,
11211144
max_tokens: Optional[int] | NotGiven = NOT_GIVEN,
@@ -1176,6 +1199,9 @@ async def create(
11761199
11771200
A list of functions the model may generate JSON inputs for.
11781201
1202+
instance_id: An unique identifier to a custom instance to execute the request. The requesting
1203+
organization is required to have access to the instance.
1204+
11791205
logit_bias: Modify the likelihood of specified tokens appearing in the completion.
11801206
11811207
Accepts a JSON object that maps tokens (specified by their token ID in the
@@ -1305,6 +1331,7 @@ async def create(
13051331
frequency_penalty: Optional[float] | NotGiven = NOT_GIVEN,
13061332
function_call: completion_create_params.FunctionCall | NotGiven = NOT_GIVEN,
13071333
functions: Iterable[completion_create_params.Function] | NotGiven = NOT_GIVEN,
1334+
instance_id: Optional[str] | NotGiven = NOT_GIVEN,
13081335
logit_bias: Optional[Dict[str, int]] | NotGiven = NOT_GIVEN,
13091336
logprobs: Optional[bool] | NotGiven = NOT_GIVEN,
13101337
max_tokens: Optional[int] | NotGiven = NOT_GIVEN,
@@ -1336,6 +1363,7 @@ async def create(
13361363
"frequency_penalty": frequency_penalty,
13371364
"function_call": function_call,
13381365
"functions": functions,
1366+
"instance_id": instance_id,
13391367
"logit_bias": logit_bias,
13401368
"logprobs": logprobs,
13411369
"max_tokens": max_tokens,

src/openai/types/chat/completion_create_params.py

+6
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,12 @@ class CompletionCreateParamsBase(TypedDict, total=False):
8787
A list of functions the model may generate JSON inputs for.
8888
"""
8989

90+
instance_id: Optional[str]
91+
"""An unique identifier to a custom instance to execute the request.
92+
93+
The requesting organization is required to have access to the instance.
94+
"""
95+
9096
logit_bias: Optional[Dict[str, int]]
9197
"""Modify the likelihood of specified tokens appearing in the completion.
9298

tests/api_resources/chat/test_completions.py

+4
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ def test_method_create_with_all_params_overload_1(self, client: OpenAI) -> None:
5050
"parameters": {"foo": "bar"},
5151
}
5252
],
53+
instance_id="string",
5354
logit_bias={"foo": 0},
5455
logprobs=True,
5556
max_tokens=0,
@@ -164,6 +165,7 @@ def test_method_create_with_all_params_overload_2(self, client: OpenAI) -> None:
164165
"parameters": {"foo": "bar"},
165166
}
166167
],
168+
instance_id="string",
167169
logit_bias={"foo": 0},
168170
logprobs=True,
169171
max_tokens=0,
@@ -280,6 +282,7 @@ async def test_method_create_with_all_params_overload_1(self, async_client: Asyn
280282
"parameters": {"foo": "bar"},
281283
}
282284
],
285+
instance_id="string",
283286
logit_bias={"foo": 0},
284287
logprobs=True,
285288
max_tokens=0,
@@ -394,6 +397,7 @@ async def test_method_create_with_all_params_overload_2(self, async_client: Asyn
394397
"parameters": {"foo": "bar"},
395398
}
396399
],
400+
instance_id="string",
397401
logit_bias={"foo": 0},
398402
logprobs=True,
399403
max_tokens=0,

0 commit comments

Comments
 (0)