Skip to content

Commit 0843a11

Browse files
feat(api): add new text parameters, expiration options
1 parent 34014ae commit 0843a11

37 files changed

+343
-245
lines changed

.stats.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 111
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-9cadfad609f94f20ebf74fdc06a80302f1a324dc69700a309a8056aabca82fd2.yml
3-
openapi_spec_hash: 3eb8d86c06f0bb5e1190983e5acfc9ba
4-
config_hash: 68337b532875626269c304372a669f67
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-24be531010b354303d741fc9247c1f84f75978f9f7de68aca92cb4f240a04722.yml
3+
openapi_spec_hash: 3e46f439f6a863beadc71577eb4efa15
4+
config_hash: ed87b9139ac595a04a2162d754df2fed

src/openai/resources/batches.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ def create(
4949
endpoint: Literal["/v1/responses", "/v1/chat/completions", "/v1/embeddings", "/v1/completions"],
5050
input_file_id: str,
5151
metadata: Optional[Metadata] | NotGiven = NOT_GIVEN,
52+
output_expires_after: batch_create_params.OutputExpiresAfter | NotGiven = NOT_GIVEN,
5253
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
5354
# The extra values given here take precedence over values defined on the client or passed to this method.
5455
extra_headers: Headers | None = None,
@@ -85,6 +86,9 @@ def create(
8586
Keys are strings with a maximum length of 64 characters. Values are strings with
8687
a maximum length of 512 characters.
8788
89+
output_expires_after: The expiration policy for the output and/or error file that are generated for a
90+
batch.
91+
8892
extra_headers: Send extra headers
8993
9094
extra_query: Add additional query parameters to the request
@@ -101,6 +105,7 @@ def create(
101105
"endpoint": endpoint,
102106
"input_file_id": input_file_id,
103107
"metadata": metadata,
108+
"output_expires_after": output_expires_after,
104109
},
105110
batch_create_params.BatchCreateParams,
106111
),
@@ -259,6 +264,7 @@ async def create(
259264
endpoint: Literal["/v1/responses", "/v1/chat/completions", "/v1/embeddings", "/v1/completions"],
260265
input_file_id: str,
261266
metadata: Optional[Metadata] | NotGiven = NOT_GIVEN,
267+
output_expires_after: batch_create_params.OutputExpiresAfter | NotGiven = NOT_GIVEN,
262268
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
263269
# The extra values given here take precedence over values defined on the client or passed to this method.
264270
extra_headers: Headers | None = None,
@@ -295,6 +301,9 @@ async def create(
295301
Keys are strings with a maximum length of 64 characters. Values are strings with
296302
a maximum length of 512 characters.
297303
304+
output_expires_after: The expiration policy for the output and/or error file that are generated for a
305+
batch.
306+
298307
extra_headers: Send extra headers
299308
300309
extra_query: Add additional query parameters to the request
@@ -311,6 +320,7 @@ async def create(
311320
"endpoint": endpoint,
312321
"input_file_id": input_file_id,
313322
"metadata": metadata,
323+
"output_expires_after": output_expires_after,
314324
},
315325
batch_create_params.BatchCreateParams,
316326
),

src/openai/resources/beta/realtime/realtime.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -652,8 +652,8 @@ def cancel(self, *, event_id: str | NotGiven = NOT_GIVEN, response_id: str | Not
652652
"""Send this event to cancel an in-progress response.
653653
654654
The server will respond
655-
with a `response.cancelled` event or an error if there is no response to
656-
cancel.
655+
with a `response.done` event with a status of `response.status=cancelled`. If
656+
there is no response to cancel, the server will respond with an error.
657657
"""
658658
self._connection.send(
659659
cast(
@@ -904,8 +904,8 @@ async def cancel(self, *, event_id: str | NotGiven = NOT_GIVEN, response_id: str
904904
"""Send this event to cancel an in-progress response.
905905
906906
The server will respond
907-
with a `response.cancelled` event or an error if there is no response to
908-
cancel.
907+
with a `response.done` event with a status of `response.status=cancelled`. If
908+
there is no response to cancel, the server will respond with an error.
909909
"""
910910
await self._connection.send(
911911
cast(

src/openai/resources/beta/realtime/sessions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ def create(
152152
set to `null` to turn off, in which case the client must manually trigger model
153153
response. Server VAD means that the model will detect the start and end of
154154
speech based on audio volume and respond at the end of user speech. Semantic VAD
155-
is more advanced and uses a turn detection model (in conjuction with VAD) to
155+
is more advanced and uses a turn detection model (in conjunction with VAD) to
156156
semantically estimate whether the user has finished speaking, then dynamically
157157
sets a timeout based on this probability. For example, if user audio trails off
158158
with "uhhm", the model will score a low probability of turn end and wait longer
@@ -334,7 +334,7 @@ async def create(
334334
set to `null` to turn off, in which case the client must manually trigger model
335335
response. Server VAD means that the model will detect the start and end of
336336
speech based on audio volume and respond at the end of user speech. Semantic VAD
337-
is more advanced and uses a turn detection model (in conjuction with VAD) to
337+
is more advanced and uses a turn detection model (in conjunction with VAD) to
338338
semantically estimate whether the user has finished speaking, then dynamically
339339
sets a timeout based on this probability. For example, if user audio trails off
340340
with "uhhm", the model will score a low probability of turn end and wait longer

src/openai/resources/beta/realtime/transcription_sessions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def create(
9696
set to `null` to turn off, in which case the client must manually trigger model
9797
response. Server VAD means that the model will detect the start and end of
9898
speech based on audio volume and respond at the end of user speech. Semantic VAD
99-
is more advanced and uses a turn detection model (in conjuction with VAD) to
99+
is more advanced and uses a turn detection model (in conjunction with VAD) to
100100
semantically estimate whether the user has finished speaking, then dynamically
101101
sets a timeout based on this probability. For example, if user audio trails off
102102
with "uhhm", the model will score a low probability of turn end and wait longer
@@ -209,7 +209,7 @@ async def create(
209209
set to `null` to turn off, in which case the client must manually trigger model
210210
response. Server VAD means that the model will detect the start and end of
211211
speech based on audio volume and respond at the end of user speech. Semantic VAD
212-
is more advanced and uses a turn detection model (in conjuction with VAD) to
212+
is more advanced and uses a turn detection model (in conjunction with VAD) to
213213
semantically estimate whether the user has finished speaking, then dynamically
214214
sets a timeout based on this probability. For example, if user audio trails off
215215
with "uhhm", the model will score a low probability of turn end and wait longer

src/openai/resources/beta/threads/runs/runs.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ def create(
220220
We generally recommend altering this or temperature but not both.
221221
222222
truncation_strategy: Controls for how a thread will be truncated prior to the run. Use this to
223-
control the intial context window of the run.
223+
control the initial context window of the run.
224224
225225
extra_headers: Send extra headers
226226
@@ -370,7 +370,7 @@ def create(
370370
We generally recommend altering this or temperature but not both.
371371
372372
truncation_strategy: Controls for how a thread will be truncated prior to the run. Use this to
373-
control the intial context window of the run.
373+
control the initial context window of the run.
374374
375375
extra_headers: Send extra headers
376376
@@ -520,7 +520,7 @@ def create(
520520
We generally recommend altering this or temperature but not both.
521521
522522
truncation_strategy: Controls for how a thread will be truncated prior to the run. Use this to
523-
control the intial context window of the run.
523+
control the initial context window of the run.
524524
525525
extra_headers: Send extra headers
526526
@@ -1650,7 +1650,7 @@ async def create(
16501650
We generally recommend altering this or temperature but not both.
16511651
16521652
truncation_strategy: Controls for how a thread will be truncated prior to the run. Use this to
1653-
control the intial context window of the run.
1653+
control the initial context window of the run.
16541654
16551655
extra_headers: Send extra headers
16561656
@@ -1800,7 +1800,7 @@ async def create(
18001800
We generally recommend altering this or temperature but not both.
18011801
18021802
truncation_strategy: Controls for how a thread will be truncated prior to the run. Use this to
1803-
control the intial context window of the run.
1803+
control the initial context window of the run.
18041804
18051805
extra_headers: Send extra headers
18061806
@@ -1950,7 +1950,7 @@ async def create(
19501950
We generally recommend altering this or temperature but not both.
19511951
19521952
truncation_strategy: Controls for how a thread will be truncated prior to the run. Use this to
1953-
control the intial context window of the run.
1953+
control the initial context window of the run.
19541954
19551955
extra_headers: Send extra headers
19561956

src/openai/resources/beta/threads/threads.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ def create_and_run(
393393
We generally recommend altering this or temperature but not both.
394394
395395
truncation_strategy: Controls for how a thread will be truncated prior to the run. Use this to
396-
control the intial context window of the run.
396+
control the initial context window of the run.
397397
398398
extra_headers: Send extra headers
399399
@@ -527,7 +527,7 @@ def create_and_run(
527527
We generally recommend altering this or temperature but not both.
528528
529529
truncation_strategy: Controls for how a thread will be truncated prior to the run. Use this to
530-
control the intial context window of the run.
530+
control the initial context window of the run.
531531
532532
extra_headers: Send extra headers
533533
@@ -661,7 +661,7 @@ def create_and_run(
661661
We generally recommend altering this or temperature but not both.
662662
663663
truncation_strategy: Controls for how a thread will be truncated prior to the run. Use this to
664-
control the intial context window of the run.
664+
control the initial context window of the run.
665665
666666
extra_headers: Send extra headers
667667
@@ -1251,7 +1251,7 @@ async def create_and_run(
12511251
We generally recommend altering this or temperature but not both.
12521252
12531253
truncation_strategy: Controls for how a thread will be truncated prior to the run. Use this to
1254-
control the intial context window of the run.
1254+
control the initial context window of the run.
12551255
12561256
extra_headers: Send extra headers
12571257
@@ -1385,7 +1385,7 @@ async def create_and_run(
13851385
We generally recommend altering this or temperature but not both.
13861386
13871387
truncation_strategy: Controls for how a thread will be truncated prior to the run. Use this to
1388-
control the intial context window of the run.
1388+
control the initial context window of the run.
13891389
13901390
extra_headers: Send extra headers
13911391
@@ -1519,7 +1519,7 @@ async def create_and_run(
15191519
We generally recommend altering this or temperature but not both.
15201520
15211521
truncation_strategy: Controls for how a thread will be truncated prior to the run. Use this to
1522-
control the intial context window of the run.
1522+
control the initial context window of the run.
15231523
15241524
extra_headers: Send extra headers
15251525

0 commit comments

Comments
 (0)