Skip to content

Commit dfdcf57

Browse files
Stainless Botstainless-app[bot]
Stainless Bot
authored andcommitted
feat(api): add support for predicted outputs (openai#1847)
1 parent cb88c2f commit dfdcf57

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+450
-284
lines changed

.stats.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 68
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai-7b0a5d715d94f75ac7795bd4d2175a0e3243af9b935a86c273f371e45583140f.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai-2f8ca92b9b1879fd535b685e4767338413fcd533d42f3baac13a9c41da3fce35.yml

api.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ from openai.types.chat import (
5454
ChatCompletionMessageToolCall,
5555
ChatCompletionModality,
5656
ChatCompletionNamedToolChoice,
57+
ChatCompletionPredictionContent,
5758
ChatCompletionRole,
5859
ChatCompletionStreamOptions,
5960
ChatCompletionSystemMessageParam,
@@ -93,7 +94,7 @@ Methods:
9394

9495
- <code title="post /files">client.files.<a href="./src/openai/resources/files.py">create</a>(\*\*<a href="src/openai/types/file_create_params.py">params</a>) -> <a href="./src/openai/types/file_object.py">FileObject</a></code>
9596
- <code title="get /files/{file_id}">client.files.<a href="./src/openai/resources/files.py">retrieve</a>(file_id) -> <a href="./src/openai/types/file_object.py">FileObject</a></code>
96-
- <code title="get /files">client.files.<a href="./src/openai/resources/files.py">list</a>(\*\*<a href="src/openai/types/file_list_params.py">params</a>) -> <a href="./src/openai/types/file_object.py">SyncPage[FileObject]</a></code>
97+
- <code title="get /files">client.files.<a href="./src/openai/resources/files.py">list</a>(\*\*<a href="src/openai/types/file_list_params.py">params</a>) -> <a href="./src/openai/types/file_object.py">SyncCursorPage[FileObject]</a></code>
9798
- <code title="delete /files/{file_id}">client.files.<a href="./src/openai/resources/files.py">delete</a>(file_id) -> <a href="./src/openai/types/file_deleted.py">FileDeleted</a></code>
9899
- <code title="get /files/{file_id}/content">client.files.<a href="./src/openai/resources/files.py">content</a>(file_id) -> HttpxBinaryResponseContent</code>
99100
- <code title="get /files/{file_id}/content">client.files.<a href="./src/openai/resources/files.py">retrieve_content</a>(file_id) -> str</code>

src/openai/resources/audio/speech.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,13 @@ def create(
7070
input: The text to generate audio for. The maximum length is 4096 characters.
7171
7272
model:
73-
One of the available [TTS models](https://platform.openai.com/docs/models/tts):
73+
One of the available [TTS models](https://platform.openai.com/docs/models#tts):
7474
`tts-1` or `tts-1-hd`
7575
7676
voice: The voice to use when generating the audio. Supported voices are `alloy`,
7777
`echo`, `fable`, `onyx`, `nova`, and `shimmer`. Previews of the voices are
7878
available in the
79-
[Text to speech guide](https://platform.openai.com/docs/guides/text-to-speech/voice-options).
79+
[Text to speech guide](https://platform.openai.com/docs/guides/text-to-speech#voice-options).
8080
8181
response_format: The format to audio in. Supported formats are `mp3`, `opus`, `aac`, `flac`,
8282
`wav`, and `pcm`.
@@ -154,13 +154,13 @@ async def create(
154154
input: The text to generate audio for. The maximum length is 4096 characters.
155155
156156
model:
157-
One of the available [TTS models](https://platform.openai.com/docs/models/tts):
157+
One of the available [TTS models](https://platform.openai.com/docs/models#tts):
158158
`tts-1` or `tts-1-hd`
159159
160160
voice: The voice to use when generating the audio. Supported voices are `alloy`,
161161
`echo`, `fable`, `onyx`, `nova`, and `shimmer`. Previews of the voices are
162162
available in the
163-
[Text to speech guide](https://platform.openai.com/docs/guides/text-to-speech/voice-options).
163+
[Text to speech guide](https://platform.openai.com/docs/guides/text-to-speech#voice-options).
164164
165165
response_format: The format to audio in. Supported formats are `mp3`, `opus`, `aac`, `flac`,
166166
`wav`, and `pcm`.

src/openai/resources/audio/transcriptions.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ def create(
143143
144144
prompt: An optional text to guide the model's style or continue a previous audio
145145
segment. The
146-
[prompt](https://platform.openai.com/docs/guides/speech-to-text/prompting)
146+
[prompt](https://platform.openai.com/docs/guides/speech-to-text#prompting)
147147
should match the audio language.
148148
149149
response_format: The format of the output, in one of these options: `json`, `text`, `srt`,
@@ -307,7 +307,7 @@ async def create(
307307
308308
prompt: An optional text to guide the model's style or continue a previous audio
309309
segment. The
310-
[prompt](https://platform.openai.com/docs/guides/speech-to-text/prompting)
310+
[prompt](https://platform.openai.com/docs/guides/speech-to-text#prompting)
311311
should match the audio language.
312312
313313
response_format: The format of the output, in one of these options: `json`, `text`, `srt`,

src/openai/resources/audio/translations.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ def create(
130130
131131
prompt: An optional text to guide the model's style or continue a previous audio
132132
segment. The
133-
[prompt](https://platform.openai.com/docs/guides/speech-to-text/prompting)
133+
[prompt](https://platform.openai.com/docs/guides/speech-to-text#prompting)
134134
should be in English.
135135
136136
response_format: The format of the output, in one of these options: `json`, `text`, `srt`,
@@ -273,7 +273,7 @@ async def create(
273273
274274
prompt: An optional text to guide the model's style or continue a previous audio
275275
segment. The
276-
[prompt](https://platform.openai.com/docs/guides/speech-to-text/prompting)
276+
[prompt](https://platform.openai.com/docs/guides/speech-to-text#prompting)
277277
should be in English.
278278
279279
response_format: The format of the output, in one of these options: `json`, `text`, `srt`,

src/openai/resources/beta/assistants.py

+20-20
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ def create(
7979
model: ID of the model to use. You can use the
8080
[List models](https://platform.openai.com/docs/api-reference/models/list) API to
8181
see all of your available models, or see our
82-
[Model overview](https://platform.openai.com/docs/models/overview) for
83-
descriptions of them.
82+
[Model overview](https://platform.openai.com/docs/models) for descriptions of
83+
them.
8484
8585
description: The description of the assistant. The maximum length is 512 characters.
8686
@@ -95,8 +95,8 @@ def create(
9595
name: The name of the assistant. The maximum length is 256 characters.
9696
9797
response_format: Specifies the format that the model must output. Compatible with
98-
[GPT-4o](https://platform.openai.com/docs/models/gpt-4o),
99-
[GPT-4 Turbo](https://platform.openai.com/docs/models/gpt-4-turbo-and-gpt-4),
98+
[GPT-4o](https://platform.openai.com/docs/models#gpt-4o),
99+
[GPT-4 Turbo](https://platform.openai.com/docs/models#gpt-4-turbo-and-gpt-4),
100100
and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`.
101101
102102
Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured
@@ -239,14 +239,14 @@ def update(
239239
model: ID of the model to use. You can use the
240240
[List models](https://platform.openai.com/docs/api-reference/models/list) API to
241241
see all of your available models, or see our
242-
[Model overview](https://platform.openai.com/docs/models/overview) for
243-
descriptions of them.
242+
[Model overview](https://platform.openai.com/docs/models) for descriptions of
243+
them.
244244
245245
name: The name of the assistant. The maximum length is 256 characters.
246246
247247
response_format: Specifies the format that the model must output. Compatible with
248-
[GPT-4o](https://platform.openai.com/docs/models/gpt-4o),
249-
[GPT-4 Turbo](https://platform.openai.com/docs/models/gpt-4-turbo-and-gpt-4),
248+
[GPT-4o](https://platform.openai.com/docs/models#gpt-4o),
249+
[GPT-4 Turbo](https://platform.openai.com/docs/models#gpt-4-turbo-and-gpt-4),
250250
and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`.
251251
252252
Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured
@@ -344,8 +344,8 @@ def list(
344344
345345
before: A cursor for use in pagination. `before` is an object ID that defines your place
346346
in the list. For instance, if you make a list request and receive 100 objects,
347-
ending with obj_foo, your subsequent call can include before=obj_foo in order to
348-
fetch the previous page of the list.
347+
starting with obj_foo, your subsequent call can include before=obj_foo in order
348+
to fetch the previous page of the list.
349349
350350
limit: A limit on the number of objects to be returned. Limit can range between 1 and
351351
100, and the default is 20.
@@ -465,8 +465,8 @@ async def create(
465465
model: ID of the model to use. You can use the
466466
[List models](https://platform.openai.com/docs/api-reference/models/list) API to
467467
see all of your available models, or see our
468-
[Model overview](https://platform.openai.com/docs/models/overview) for
469-
descriptions of them.
468+
[Model overview](https://platform.openai.com/docs/models) for descriptions of
469+
them.
470470
471471
description: The description of the assistant. The maximum length is 512 characters.
472472
@@ -481,8 +481,8 @@ async def create(
481481
name: The name of the assistant. The maximum length is 256 characters.
482482
483483
response_format: Specifies the format that the model must output. Compatible with
484-
[GPT-4o](https://platform.openai.com/docs/models/gpt-4o),
485-
[GPT-4 Turbo](https://platform.openai.com/docs/models/gpt-4-turbo-and-gpt-4),
484+
[GPT-4o](https://platform.openai.com/docs/models#gpt-4o),
485+
[GPT-4 Turbo](https://platform.openai.com/docs/models#gpt-4-turbo-and-gpt-4),
486486
and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`.
487487
488488
Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured
@@ -625,14 +625,14 @@ async def update(
625625
model: ID of the model to use. You can use the
626626
[List models](https://platform.openai.com/docs/api-reference/models/list) API to
627627
see all of your available models, or see our
628-
[Model overview](https://platform.openai.com/docs/models/overview) for
629-
descriptions of them.
628+
[Model overview](https://platform.openai.com/docs/models) for descriptions of
629+
them.
630630
631631
name: The name of the assistant. The maximum length is 256 characters.
632632
633633
response_format: Specifies the format that the model must output. Compatible with
634-
[GPT-4o](https://platform.openai.com/docs/models/gpt-4o),
635-
[GPT-4 Turbo](https://platform.openai.com/docs/models/gpt-4-turbo-and-gpt-4),
634+
[GPT-4o](https://platform.openai.com/docs/models#gpt-4o),
635+
[GPT-4 Turbo](https://platform.openai.com/docs/models#gpt-4-turbo-and-gpt-4),
636636
and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`.
637637
638638
Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured
@@ -730,8 +730,8 @@ def list(
730730
731731
before: A cursor for use in pagination. `before` is an object ID that defines your place
732732
in the list. For instance, if you make a list request and receive 100 objects,
733-
ending with obj_foo, your subsequent call can include before=obj_foo in order to
734-
fetch the previous page of the list.
733+
starting with obj_foo, your subsequent call can include before=obj_foo in order
734+
to fetch the previous page of the list.
735735
736736
limit: A limit on the number of objects to be returned. Limit can range between 1 and
737737
100, and the default is 20.

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

+4-4
Original file line numberDiff line numberDiff line change
@@ -221,8 +221,8 @@ def list(
221221
222222
before: A cursor for use in pagination. `before` is an object ID that defines your place
223223
in the list. For instance, if you make a list request and receive 100 objects,
224-
ending with obj_foo, your subsequent call can include before=obj_foo in order to
225-
fetch the previous page of the list.
224+
starting with obj_foo, your subsequent call can include before=obj_foo in order
225+
to fetch the previous page of the list.
226226
227227
limit: A limit on the number of objects to be returned. Limit can range between 1 and
228228
100, and the default is 20.
@@ -495,8 +495,8 @@ def list(
495495
496496
before: A cursor for use in pagination. `before` is an object ID that defines your place
497497
in the list. For instance, if you make a list request and receive 100 objects,
498-
ending with obj_foo, your subsequent call can include before=obj_foo in order to
499-
fetch the previous page of the list.
498+
starting with obj_foo, your subsequent call can include before=obj_foo in order
499+
to fetch the previous page of the list.
500500
501501
limit: A limit on the number of objects to be returned. Limit can range between 1 and
502502
100, and the default is 20.

0 commit comments

Comments
 (0)