Skip to content

Commit 840179f

Browse files
feat(api): add support for predicted outputs (#1172)
1 parent e0b675f commit 840179f

26 files changed

+133
-80
lines changed

.stats.yml

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ Types:
4848
- <code><a href="./src/resources/chat/completions.ts">ChatCompletionMessageToolCall</a></code>
4949
- <code><a href="./src/resources/chat/completions.ts">ChatCompletionModality</a></code>
5050
- <code><a href="./src/resources/chat/completions.ts">ChatCompletionNamedToolChoice</a></code>
51+
- <code><a href="./src/resources/chat/completions.ts">ChatCompletionPredictionContent</a></code>
5152
- <code><a href="./src/resources/chat/completions.ts">ChatCompletionRole</a></code>
5253
- <code><a href="./src/resources/chat/completions.ts">ChatCompletionStreamOptions</a></code>
5354
- <code><a href="./src/resources/chat/completions.ts">ChatCompletionSystemMessageParam</a></code>

src/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ import {
8787
ChatCompletionMessageToolCall,
8888
ChatCompletionModality,
8989
ChatCompletionNamedToolChoice,
90+
ChatCompletionPredictionContent,
9091
ChatCompletionRole,
9192
ChatCompletionStreamOptions,
9293
ChatCompletionSystemMessageParam,
@@ -379,6 +380,7 @@ export declare namespace OpenAI {
379380
type ChatCompletionMessageToolCall as ChatCompletionMessageToolCall,
380381
type ChatCompletionModality as ChatCompletionModality,
381382
type ChatCompletionNamedToolChoice as ChatCompletionNamedToolChoice,
383+
type ChatCompletionPredictionContent as ChatCompletionPredictionContent,
382384
type ChatCompletionRole as ChatCompletionRole,
383385
type ChatCompletionStreamOptions as ChatCompletionStreamOptions,
384386
type ChatCompletionSystemMessageParam as ChatCompletionSystemMessageParam,

src/resources/audio/speech.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export interface SpeechCreateParams {
2222
input: string;
2323

2424
/**
25-
* One of the available [TTS models](https://platform.openai.com/docs/models/tts):
25+
* One of the available [TTS models](https://platform.openai.com/docs/models#tts):
2626
* `tts-1` or `tts-1-hd`
2727
*/
2828
model: (string & {}) | SpeechModel;
@@ -31,7 +31,7 @@ export interface SpeechCreateParams {
3131
* The voice to use when generating the audio. Supported voices are `alloy`,
3232
* `echo`, `fable`, `onyx`, `nova`, and `shimmer`. Previews of the voices are
3333
* available in the
34-
* [Text to speech guide](https://platform.openai.com/docs/guides/text-to-speech/voice-options).
34+
* [Text to speech guide](https://platform.openai.com/docs/guides/text-to-speech#voice-options).
3535
*/
3636
voice: 'alloy' | 'echo' | 'fable' | 'onyx' | 'nova' | 'shimmer';
3737

src/resources/audio/transcriptions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ export interface TranscriptionCreateParams<
174174
/**
175175
* An optional text to guide the model's style or continue a previous audio
176176
* segment. The
177-
* [prompt](https://platform.openai.com/docs/guides/speech-to-text/prompting)
177+
* [prompt](https://platform.openai.com/docs/guides/speech-to-text#prompting)
178178
* should match the audio language.
179179
*/
180180
prompt?: string;

src/resources/audio/translations.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ export interface TranslationCreateParams<
7676
/**
7777
* An optional text to guide the model's style or continue a previous audio
7878
* segment. The
79-
* [prompt](https://platform.openai.com/docs/guides/speech-to-text/prompting)
79+
* [prompt](https://platform.openai.com/docs/guides/speech-to-text#prompting)
8080
* should be in English.
8181
*/
8282
prompt?: string;

src/resources/beta/assistants.ts

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,8 @@ export interface Assistant {
121121
* ID of the model to use. You can use the
122122
* [List models](https://platform.openai.com/docs/api-reference/models/list) API to
123123
* see all of your available models, or see our
124-
* [Model overview](https://platform.openai.com/docs/models/overview) for
125-
* descriptions of them.
124+
* [Model overview](https://platform.openai.com/docs/models) for descriptions of
125+
* them.
126126
*/
127127
model: string;
128128

@@ -145,8 +145,8 @@ export interface Assistant {
145145

146146
/**
147147
* Specifies the format that the model must output. Compatible with
148-
* [GPT-4o](https://platform.openai.com/docs/models/gpt-4o),
149-
* [GPT-4 Turbo](https://platform.openai.com/docs/models/gpt-4-turbo-and-gpt-4),
148+
* [GPT-4o](https://platform.openai.com/docs/models#gpt-4o),
149+
* [GPT-4 Turbo](https://platform.openai.com/docs/models#gpt-4-turbo-and-gpt-4),
150150
* and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`.
151151
*
152152
* Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured
@@ -620,7 +620,7 @@ export namespace AssistantStreamEvent {
620620

621621
/**
622622
* Occurs when an
623-
* [error](https://platform.openai.com/docs/guides/error-codes/api-errors) occurs.
623+
* [error](https://platform.openai.com/docs/guides/error-codes#api-errors) occurs.
624624
* This can happen due to an internal server error or a timeout.
625625
*/
626626
export interface ErrorEvent {
@@ -663,7 +663,7 @@ export namespace FileSearchTool {
663663
*
664664
* Note that the file search tool may output fewer than `max_num_results` results.
665665
* See the
666-
* [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search/customizing-file-search-settings)
666+
* [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings)
667667
* for more information.
668668
*/
669669
max_num_results?: number;
@@ -673,7 +673,7 @@ export namespace FileSearchTool {
673673
* will use the `auto` ranker and a score_threshold of 0.
674674
*
675675
* See the
676-
* [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search/customizing-file-search-settings)
676+
* [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings)
677677
* for more information.
678678
*/
679679
ranking_options?: FileSearch.RankingOptions;
@@ -685,7 +685,7 @@ export namespace FileSearchTool {
685685
* will use the `auto` ranker and a score_threshold of 0.
686686
*
687687
* See the
688-
* [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search/customizing-file-search-settings)
688+
* [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings)
689689
* for more information.
690690
*/
691691
export interface RankingOptions {
@@ -1100,8 +1100,8 @@ export interface AssistantCreateParams {
11001100
* ID of the model to use. You can use the
11011101
* [List models](https://platform.openai.com/docs/api-reference/models/list) API to
11021102
* see all of your available models, or see our
1103-
* [Model overview](https://platform.openai.com/docs/models/overview) for
1104-
* descriptions of them.
1103+
* [Model overview](https://platform.openai.com/docs/models) for descriptions of
1104+
* them.
11051105
*/
11061106
model: (string & {}) | ChatAPI.ChatModel;
11071107

@@ -1131,8 +1131,8 @@ export interface AssistantCreateParams {
11311131

11321132
/**
11331133
* Specifies the format that the model must output. Compatible with
1134-
* [GPT-4o](https://platform.openai.com/docs/models/gpt-4o),
1135-
* [GPT-4 Turbo](https://platform.openai.com/docs/models/gpt-4-turbo-and-gpt-4),
1134+
* [GPT-4o](https://platform.openai.com/docs/models#gpt-4o),
1135+
* [GPT-4 Turbo](https://platform.openai.com/docs/models#gpt-4-turbo-and-gpt-4),
11361136
* and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`.
11371137
*
11381138
* Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured
@@ -1277,8 +1277,8 @@ export interface AssistantUpdateParams {
12771277
* ID of the model to use. You can use the
12781278
* [List models](https://platform.openai.com/docs/api-reference/models/list) API to
12791279
* see all of your available models, or see our
1280-
* [Model overview](https://platform.openai.com/docs/models/overview) for
1281-
* descriptions of them.
1280+
* [Model overview](https://platform.openai.com/docs/models) for descriptions of
1281+
* them.
12821282
*/
12831283
model?: string;
12841284

@@ -1289,8 +1289,8 @@ export interface AssistantUpdateParams {
12891289

12901290
/**
12911291
* Specifies the format that the model must output. Compatible with
1292-
* [GPT-4o](https://platform.openai.com/docs/models/gpt-4o),
1293-
* [GPT-4 Turbo](https://platform.openai.com/docs/models/gpt-4-turbo-and-gpt-4),
1292+
* [GPT-4o](https://platform.openai.com/docs/models#gpt-4o),
1293+
* [GPT-4 Turbo](https://platform.openai.com/docs/models#gpt-4-turbo-and-gpt-4),
12941294
* and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`.
12951295
*
12961296
* Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured
@@ -1383,8 +1383,8 @@ export interface AssistantListParams extends CursorPageParams {
13831383
/**
13841384
* A cursor for use in pagination. `before` is an object ID that defines your place
13851385
* in the list. For instance, if you make a list request and receive 100 objects,
1386-
* ending with obj_foo, your subsequent call can include before=obj_foo in order to
1387-
* fetch the previous page of the list.
1386+
* starting with obj_foo, your subsequent call can include before=obj_foo in order
1387+
* to fetch the previous page of the list.
13881388
*/
13891389
before?: string;
13901390

src/resources/beta/threads/messages.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -704,8 +704,8 @@ export interface MessageListParams extends CursorPageParams {
704704
/**
705705
* A cursor for use in pagination. `before` is an object ID that defines your place
706706
* in the list. For instance, if you make a list request and receive 100 objects,
707-
* ending with obj_foo, your subsequent call can include before=obj_foo in order to
708-
* fetch the previous page of the list.
707+
* starting with obj_foo, your subsequent call can include before=obj_foo in order
708+
* to fetch the previous page of the list.
709709
*/
710710
before?: string;
711711

src/resources/beta/threads/runs/runs.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ export interface Run {
435435

436436
/**
437437
* Whether to enable
438-
* [parallel function calling](https://platform.openai.com/docs/guides/function-calling/parallel-function-calling)
438+
* [parallel function calling](https://platform.openai.com/docs/guides/function-calling#configuring-parallel-function-calling)
439439
* during tool use.
440440
*/
441441
parallel_tool_calls: boolean;
@@ -448,8 +448,8 @@ export interface Run {
448448

449449
/**
450450
* Specifies the format that the model must output. Compatible with
451-
* [GPT-4o](https://platform.openai.com/docs/models/gpt-4o),
452-
* [GPT-4 Turbo](https://platform.openai.com/docs/models/gpt-4-turbo-and-gpt-4),
451+
* [GPT-4o](https://platform.openai.com/docs/models#gpt-4o),
452+
* [GPT-4 Turbo](https://platform.openai.com/docs/models#gpt-4-turbo-and-gpt-4),
453453
* and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`.
454454
*
455455
* Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured
@@ -660,7 +660,7 @@ export interface RunCreateParamsBase {
660660
* search result content.
661661
*
662662
* See the
663-
* [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search/customizing-file-search-settings)
663+
* [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings)
664664
* for more information.
665665
*/
666666
include?: Array<StepsAPI.RunStepInclude>;
@@ -721,15 +721,15 @@ export interface RunCreateParamsBase {
721721

722722
/**
723723
* Body param: Whether to enable
724-
* [parallel function calling](https://platform.openai.com/docs/guides/function-calling/parallel-function-calling)
724+
* [parallel function calling](https://platform.openai.com/docs/guides/function-calling#configuring-parallel-function-calling)
725725
* during tool use.
726726
*/
727727
parallel_tool_calls?: boolean;
728728

729729
/**
730730
* Body param: Specifies the format that the model must output. Compatible with
731-
* [GPT-4o](https://platform.openai.com/docs/models/gpt-4o),
732-
* [GPT-4 Turbo](https://platform.openai.com/docs/models/gpt-4-turbo-and-gpt-4),
731+
* [GPT-4o](https://platform.openai.com/docs/models#gpt-4o),
732+
* [GPT-4 Turbo](https://platform.openai.com/docs/models#gpt-4-turbo-and-gpt-4),
733733
* and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`.
734734
*
735735
* Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured
@@ -909,8 +909,8 @@ export interface RunListParams extends CursorPageParams {
909909
/**
910910
* A cursor for use in pagination. `before` is an object ID that defines your place
911911
* in the list. For instance, if you make a list request and receive 100 objects,
912-
* ending with obj_foo, your subsequent call can include before=obj_foo in order to
913-
* fetch the previous page of the list.
912+
* starting with obj_foo, your subsequent call can include before=obj_foo in order
913+
* to fetch the previous page of the list.
914914
*/
915915
before?: string;
916916

src/resources/beta/threads/runs/steps.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -705,7 +705,7 @@ export interface StepRetrieveParams {
705705
* to fetch the file search result content.
706706
*
707707
* See the
708-
* [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search/customizing-file-search-settings)
708+
* [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings)
709709
* for more information.
710710
*/
711711
include?: Array<RunStepInclude>;
@@ -715,8 +715,8 @@ export interface StepListParams extends CursorPageParams {
715715
/**
716716
* A cursor for use in pagination. `before` is an object ID that defines your place
717717
* in the list. For instance, if you make a list request and receive 100 objects,
718-
* ending with obj_foo, your subsequent call can include before=obj_foo in order to
719-
* fetch the previous page of the list.
718+
* starting with obj_foo, your subsequent call can include before=obj_foo in order
719+
* to fetch the previous page of the list.
720720
*/
721721
before?: string;
722722

@@ -726,7 +726,7 @@ export interface StepListParams extends CursorPageParams {
726726
* to fetch the file search result content.
727727
*
728728
* See the
729-
* [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search/customizing-file-search-settings)
729+
* [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings)
730730
* for more information.
731731
*/
732732
include?: Array<RunStepInclude>;

0 commit comments

Comments
 (0)