Skip to content

Commit 73c798a

Browse files
feat(api): add support for predicted outputs (openai#110)
1 parent 8b155ae commit 73c798a

23 files changed

+167
-86
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: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ Params Types:
4747
- <a href="https://pkg.go.dev/github.com/openai/openai-go">openai</a>.<a href="https://pkg.go.dev/github.com/openai/openai-go#ChatCompletionMessageToolCallParam">ChatCompletionMessageToolCallParam</a>
4848
- <a href="https://pkg.go.dev/github.com/openai/openai-go">openai</a>.<a href="https://pkg.go.dev/github.com/openai/openai-go#ChatCompletionModality">ChatCompletionModality</a>
4949
- <a href="https://pkg.go.dev/github.com/openai/openai-go">openai</a>.<a href="https://pkg.go.dev/github.com/openai/openai-go#ChatCompletionNamedToolChoiceParam">ChatCompletionNamedToolChoiceParam</a>
50+
- <a href="https://pkg.go.dev/github.com/openai/openai-go">openai</a>.<a href="https://pkg.go.dev/github.com/openai/openai-go#ChatCompletionPredictionContentParam">ChatCompletionPredictionContentParam</a>
5051
- <a href="https://pkg.go.dev/github.com/openai/openai-go">openai</a>.<a href="https://pkg.go.dev/github.com/openai/openai-go#ChatCompletionStreamOptionsParam">ChatCompletionStreamOptionsParam</a>
5152
- <a href="https://pkg.go.dev/github.com/openai/openai-go">openai</a>.<a href="https://pkg.go.dev/github.com/openai/openai-go#ChatCompletionSystemMessageParam">ChatCompletionSystemMessageParam</a>
5253
- <a href="https://pkg.go.dev/github.com/openai/openai-go">openai</a>.<a href="https://pkg.go.dev/github.com/openai/openai-go#ChatCompletionToolParam">ChatCompletionToolParam</a>
@@ -98,7 +99,7 @@ Methods:
9899

99100
- <code title="post /files">client.Files.<a href="https://pkg.go.dev/github.com/openai/openai-go#FileService.New">New</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, body <a href="https://pkg.go.dev/github.com/openai/openai-go">openai</a>.<a href="https://pkg.go.dev/github.com/openai/openai-go#FileNewParams">FileNewParams</a>) (<a href="https://pkg.go.dev/github.com/openai/openai-go">openai</a>.<a href="https://pkg.go.dev/github.com/openai/openai-go#FileObject">FileObject</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
100101
- <code title="get /files/{file_id}">client.Files.<a href="https://pkg.go.dev/github.com/openai/openai-go#FileService.Get">Get</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, fileID <a href="https://pkg.go.dev/builtin#string">string</a>) (<a href="https://pkg.go.dev/github.com/openai/openai-go">openai</a>.<a href="https://pkg.go.dev/github.com/openai/openai-go#FileObject">FileObject</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
101-
- <code title="get /files">client.Files.<a href="https://pkg.go.dev/github.com/openai/openai-go#FileService.List">List</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, query <a href="https://pkg.go.dev/github.com/openai/openai-go">openai</a>.<a href="https://pkg.go.dev/github.com/openai/openai-go#FileListParams">FileListParams</a>) (<a href="https://pkg.go.dev/github.com/openai/openai-go/packages/pagination">pagination</a>.<a href="https://pkg.go.dev/github.com/openai/openai-go/packages/pagination#Page">Page</a>[<a href="https://pkg.go.dev/github.com/openai/openai-go">openai</a>.<a href="https://pkg.go.dev/github.com/openai/openai-go#FileObject">FileObject</a>], <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
102+
- <code title="get /files">client.Files.<a href="https://pkg.go.dev/github.com/openai/openai-go#FileService.List">List</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, query <a href="https://pkg.go.dev/github.com/openai/openai-go">openai</a>.<a href="https://pkg.go.dev/github.com/openai/openai-go#FileListParams">FileListParams</a>) (<a href="https://pkg.go.dev/github.com/openai/openai-go/packages/pagination">pagination</a>.<a href="https://pkg.go.dev/github.com/openai/openai-go/packages/pagination#CursorPage">CursorPage</a>[<a href="https://pkg.go.dev/github.com/openai/openai-go">openai</a>.<a href="https://pkg.go.dev/github.com/openai/openai-go#FileObject">FileObject</a>], <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
102103
- <code title="delete /files/{file_id}">client.Files.<a href="https://pkg.go.dev/github.com/openai/openai-go#FileService.Delete">Delete</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, fileID <a href="https://pkg.go.dev/builtin#string">string</a>) (<a href="https://pkg.go.dev/github.com/openai/openai-go">openai</a>.<a href="https://pkg.go.dev/github.com/openai/openai-go#FileDeleted">FileDeleted</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
103104
- <code title="get /files/{file_id}/content">client.Files.<a href="https://pkg.go.dev/github.com/openai/openai-go#FileService.Content">Content</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, fileID <a href="https://pkg.go.dev/builtin#string">string</a>) (http.Response, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
104105
- <code title="get /files/{file_id}/content">client.Files.<a href="https://pkg.go.dev/github.com/openai/openai-go#FileService.GetContent">GetContent</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, fileID <a href="https://pkg.go.dev/builtin#string">string</a>) (<a href="https://pkg.go.dev/github.com/openai/openai-go">openai</a>.<a href="https://pkg.go.dev/github.com/openai/openai-go#FileContent">FileContent</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>

audiospeech.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,13 @@ const (
5050
type AudioSpeechNewParams struct {
5151
// The text to generate audio for. The maximum length is 4096 characters.
5252
Input param.Field[string] `json:"input,required"`
53-
// One of the available [TTS models](https://platform.openai.com/docs/models/tts):
53+
// One of the available [TTS models](https://platform.openai.com/docs/models#tts):
5454
// `tts-1` or `tts-1-hd`
5555
Model param.Field[SpeechModel] `json:"model,required"`
5656
// The voice to use when generating the audio. Supported voices are `alloy`,
5757
// `echo`, `fable`, `onyx`, `nova`, and `shimmer`. Previews of the voices are
5858
// available in the
59-
// [Text to speech guide](https://platform.openai.com/docs/guides/text-to-speech/voice-options).
59+
// [Text to speech guide](https://platform.openai.com/docs/guides/text-to-speech#voice-options).
6060
Voice param.Field[AudioSpeechNewParamsVoice] `json:"voice,required"`
6161
// The format to audio in. Supported formats are `mp3`, `opus`, `aac`, `flac`,
6262
// `wav`, and `pcm`.
@@ -73,7 +73,7 @@ func (r AudioSpeechNewParams) MarshalJSON() (data []byte, err error) {
7373
// The voice to use when generating the audio. Supported voices are `alloy`,
7474
// `echo`, `fable`, `onyx`, `nova`, and `shimmer`. Previews of the voices are
7575
// available in the
76-
// [Text to speech guide](https://platform.openai.com/docs/guides/text-to-speech/voice-options).
76+
// [Text to speech guide](https://platform.openai.com/docs/guides/text-to-speech#voice-options).
7777
type AudioSpeechNewParamsVoice string
7878

7979
const (

audiotranscription.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ type AudioTranscriptionNewParams struct {
7979
Language param.Field[string] `json:"language"`
8080
// An optional text to guide the model's style or continue a previous audio
8181
// segment. The
82-
// [prompt](https://platform.openai.com/docs/guides/speech-to-text/prompting)
82+
// [prompt](https://platform.openai.com/docs/guides/speech-to-text#prompting)
8383
// should match the audio language.
8484
Prompt param.Field[string] `json:"prompt"`
8585
// The format of the output, in one of these options: `json`, `text`, `srt`,

audiotranslation.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ type AudioTranslationNewParams struct {
7272
Model param.Field[AudioModel] `json:"model,required"`
7373
// An optional text to guide the model's style or continue a previous audio
7474
// segment. The
75-
// [prompt](https://platform.openai.com/docs/guides/speech-to-text/prompting)
75+
// [prompt](https://platform.openai.com/docs/guides/speech-to-text#prompting)
7676
// should be in English.
7777
Prompt param.Field[string] `json:"prompt"`
7878
// The format of the output, in one of these options: `json`, `text`, `srt`,

betaassistant.go

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,8 @@ type Assistant struct {
129129
// ID of the model to use. You can use the
130130
// [List models](https://platform.openai.com/docs/api-reference/models/list) API to
131131
// see all of your available models, or see our
132-
// [Model overview](https://platform.openai.com/docs/models/overview) for
133-
// descriptions of them.
132+
// [Model overview](https://platform.openai.com/docs/models) for descriptions of
133+
// them.
134134
Model string `json:"model,required"`
135135
// The name of the assistant. The maximum length is 256 characters.
136136
Name string `json:"name,required,nullable"`
@@ -1572,7 +1572,7 @@ func (r AssistantStreamEventThreadMessageIncompleteEvent) IsKnown() bool {
15721572
}
15731573

15741574
// Occurs when an
1575-
// [error](https://platform.openai.com/docs/guides/error-codes/api-errors) occurs.
1575+
// [error](https://platform.openai.com/docs/guides/error-codes#api-errors) occurs.
15761576
// This can happen due to an internal server error or a timeout.
15771577
type AssistantStreamEventErrorEvent struct {
15781578
Data shared.ErrorObject `json:"data,required"`
@@ -1867,14 +1867,14 @@ type FileSearchToolFileSearch struct {
18671867
//
18681868
// Note that the file search tool may output fewer than `max_num_results` results.
18691869
// See the
1870-
// [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search/customizing-file-search-settings)
1870+
// [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings)
18711871
// for more information.
18721872
MaxNumResults int64 `json:"max_num_results"`
18731873
// The ranking options for the file search. If not specified, the file search tool
18741874
// will use the `auto` ranker and a score_threshold of 0.
18751875
//
18761876
// See the
1877-
// [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search/customizing-file-search-settings)
1877+
// [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings)
18781878
// for more information.
18791879
RankingOptions FileSearchToolFileSearchRankingOptions `json:"ranking_options"`
18801880
JSON fileSearchToolFileSearchJSON `json:"-"`
@@ -1901,7 +1901,7 @@ func (r fileSearchToolFileSearchJSON) RawJSON() string {
19011901
// will use the `auto` ranker and a score_threshold of 0.
19021902
//
19031903
// See the
1904-
// [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search/customizing-file-search-settings)
1904+
// [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings)
19051905
// for more information.
19061906
type FileSearchToolFileSearchRankingOptions struct {
19071907
// The score threshold for the file search. All values must be a floating point
@@ -1970,14 +1970,14 @@ type FileSearchToolFileSearchParam struct {
19701970
//
19711971
// Note that the file search tool may output fewer than `max_num_results` results.
19721972
// See the
1973-
// [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search/customizing-file-search-settings)
1973+
// [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings)
19741974
// for more information.
19751975
MaxNumResults param.Field[int64] `json:"max_num_results"`
19761976
// The ranking options for the file search. If not specified, the file search tool
19771977
// will use the `auto` ranker and a score_threshold of 0.
19781978
//
19791979
// See the
1980-
// [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search/customizing-file-search-settings)
1980+
// [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings)
19811981
// for more information.
19821982
RankingOptions param.Field[FileSearchToolFileSearchRankingOptionsParam] `json:"ranking_options"`
19831983
}
@@ -1990,7 +1990,7 @@ func (r FileSearchToolFileSearchParam) MarshalJSON() (data []byte, err error) {
19901990
// will use the `auto` ranker and a score_threshold of 0.
19911991
//
19921992
// See the
1993-
// [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search/customizing-file-search-settings)
1993+
// [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings)
19941994
// for more information.
19951995
type FileSearchToolFileSearchRankingOptionsParam struct {
19961996
// The score threshold for the file search. All values must be a floating point
@@ -2063,8 +2063,8 @@ type BetaAssistantNewParams struct {
20632063
// ID of the model to use. You can use the
20642064
// [List models](https://platform.openai.com/docs/api-reference/models/list) API to
20652065
// see all of your available models, or see our
2066-
// [Model overview](https://platform.openai.com/docs/models/overview) for
2067-
// descriptions of them.
2066+
// [Model overview](https://platform.openai.com/docs/models) for descriptions of
2067+
// them.
20682068
Model param.Field[ChatModel] `json:"model,required"`
20692069
// The description of the assistant. The maximum length is 512 characters.
20702070
Description param.Field[string] `json:"description"`
@@ -2177,8 +2177,8 @@ type BetaAssistantUpdateParams struct {
21772177
// ID of the model to use. You can use the
21782178
// [List models](https://platform.openai.com/docs/api-reference/models/list) API to
21792179
// see all of your available models, or see our
2180-
// [Model overview](https://platform.openai.com/docs/models/overview) for
2181-
// descriptions of them.
2180+
// [Model overview](https://platform.openai.com/docs/models) for descriptions of
2181+
// them.
21822182
Model param.Field[string] `json:"model"`
21832183
// The name of the assistant. The maximum length is 256 characters.
21842184
Name param.Field[string] `json:"name"`
@@ -2252,8 +2252,8 @@ type BetaAssistantListParams struct {
22522252
After param.Field[string] `query:"after"`
22532253
// A cursor for use in pagination. `before` is an object ID that defines your place
22542254
// in the list. For instance, if you make a list request and receive 100 objects,
2255-
// ending with obj_foo, your subsequent call can include before=obj_foo in order to
2256-
// fetch the previous page of the list.
2255+
// starting with obj_foo, your subsequent call can include before=obj_foo in order
2256+
// to fetch the previous page of the list.
22572257
Before param.Field[string] `query:"before"`
22582258
// A limit on the number of objects to be returned. Limit can range between 1 and
22592259
// 100, and the default is 20.

betathread.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ type BetaThreadNewParamsMessage struct {
469469
// An array of content parts with a defined type, each can be of type `text` or
470470
// images can be passed with `image_url` or `image_file`. Image types are only
471471
// supported on
472-
// [Vision-compatible models](https://platform.openai.com/docs/models/overview).
472+
// [Vision-compatible models](https://platform.openai.com/docs/models).
473473
Content param.Field[[]MessageContentPartParamUnion] `json:"content,required"`
474474
// The role of the entity that is creating the message. Allowed values include:
475475
//
@@ -729,7 +729,7 @@ type BetaThreadNewAndRunParams struct {
729729
// assistant will be used.
730730
Model param.Field[ChatModel] `json:"model"`
731731
// Whether to enable
732-
// [parallel function calling](https://platform.openai.com/docs/guides/function-calling/parallel-function-calling)
732+
// [parallel function calling](https://platform.openai.com/docs/guides/function-calling#configuring-parallel-function-calling)
733733
// during tool use.
734734
ParallelToolCalls param.Field[bool] `json:"parallel_tool_calls"`
735735
// What sampling temperature to use, between 0 and 2. Higher values like 0.8 will
@@ -794,7 +794,7 @@ type BetaThreadNewAndRunParamsThreadMessage struct {
794794
// An array of content parts with a defined type, each can be of type `text` or
795795
// images can be passed with `image_url` or `image_file`. Image types are only
796796
// supported on
797-
// [Vision-compatible models](https://platform.openai.com/docs/models/overview).
797+
// [Vision-compatible models](https://platform.openai.com/docs/models).
798798
Content param.Field[[]MessageContentPartParamUnion] `json:"content,required"`
799799
// The role of the entity that is creating the message. Allowed values include:
800800
//

betathreadmessage.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1952,7 +1952,7 @@ type BetaThreadMessageNewParams struct {
19521952
// An array of content parts with a defined type, each can be of type `text` or
19531953
// images can be passed with `image_url` or `image_file`. Image types are only
19541954
// supported on
1955-
// [Vision-compatible models](https://platform.openai.com/docs/models/overview).
1955+
// [Vision-compatible models](https://platform.openai.com/docs/models).
19561956
Content param.Field[[]MessageContentPartParamUnion] `json:"content,required"`
19571957
// The role of the entity that is creating the message. Allowed values include:
19581958
//
@@ -2088,8 +2088,8 @@ type BetaThreadMessageListParams struct {
20882088
After param.Field[string] `query:"after"`
20892089
// A cursor for use in pagination. `before` is an object ID that defines your place
20902090
// in the list. For instance, if you make a list request and receive 100 objects,
2091-
// ending with obj_foo, your subsequent call can include before=obj_foo in order to
2092-
// fetch the previous page of the list.
2091+
// starting with obj_foo, your subsequent call can include before=obj_foo in order
2092+
// to fetch the previous page of the list.
20932093
Before param.Field[string] `query:"before"`
20942094
// A limit on the number of objects to be returned. Limit can range between 1 and
20952095
// 100, and the default is 20.

0 commit comments

Comments
 (0)