Skip to content

Commit d8ec8ff

Browse files
feat(api): add support for predicted outputs (#1847)
1 parent 1fa56d0 commit d8ec8ff

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

+447
-278
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
@@ -82,7 +82,7 @@ def create(
8282
8383
prompt: An optional text to guide the model's style or continue a previous audio
8484
segment. The
85-
[prompt](https://platform.openai.com/docs/guides/speech-to-text/prompting)
85+
[prompt](https://platform.openai.com/docs/guides/speech-to-text#prompting)
8686
should match the audio language.
8787
8888
response_format: The format of the output, in one of these options: `json`, `text`, `srt`,
@@ -194,7 +194,7 @@ async def create(
194194
195195
prompt: An optional text to guide the model's style or continue a previous audio
196196
segment. The
197-
[prompt](https://platform.openai.com/docs/guides/speech-to-text/prompting)
197+
[prompt](https://platform.openai.com/docs/guides/speech-to-text#prompting)
198198
should match the audio language.
199199
200200
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
@@ -74,7 +74,7 @@ def create(
7474
7575
prompt: An optional text to guide the model's style or continue a previous audio
7676
segment. The
77-
[prompt](https://platform.openai.com/docs/guides/speech-to-text/prompting)
77+
[prompt](https://platform.openai.com/docs/guides/speech-to-text#prompting)
7878
should be in English.
7979
8080
response_format: The format of the output, in one of these options: `json`, `text`, `srt`,
@@ -171,7 +171,7 @@ async def create(
171171
172172
prompt: An optional text to guide the model's style or continue a previous audio
173173
segment. The
174-
[prompt](https://platform.openai.com/docs/guides/speech-to-text/prompting)
174+
[prompt](https://platform.openai.com/docs/guides/speech-to-text#prompting)
175175
should be in English.
176176
177177
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
@@ -218,8 +218,8 @@ def list(
218218
219219
before: A cursor for use in pagination. `before` is an object ID that defines your place
220220
in the list. For instance, if you make a list request and receive 100 objects,
221-
ending with obj_foo, your subsequent call can include before=obj_foo in order to
222-
fetch the previous page of the list.
221+
starting with obj_foo, your subsequent call can include before=obj_foo in order
222+
to fetch the previous page of the list.
223223
224224
limit: A limit on the number of objects to be returned. Limit can range between 1 and
225225
100, and the default is 20.
@@ -492,8 +492,8 @@ def list(
492492
493493
before: A cursor for use in pagination. `before` is an object ID that defines your place
494494
in the list. For instance, if you make a list request and receive 100 objects,
495-
ending with obj_foo, your subsequent call can include before=obj_foo in order to
496-
fetch the previous page of the list.
495+
starting with obj_foo, your subsequent call can include before=obj_foo in order
496+
to fetch the previous page of the list.
497497
498498
limit: A limit on the number of objects to be returned. Limit can range between 1 and
499499
100, and the default is 20.

0 commit comments

Comments
 (0)