Skip to content

Commit

Permalink
feat(api): add support for predicted outputs (#110)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed Nov 4, 2024
1 parent 8b155ae commit ab88fa9
Show file tree
Hide file tree
Showing 23 changed files with 167 additions and 86 deletions.
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 68
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai-7b0a5d715d94f75ac7795bd4d2175a0e3243af9b935a86c273f371e45583140f.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai-2f8ca92b9b1879fd535b685e4767338413fcd533d42f3baac13a9c41da3fce35.yml
3 changes: 2 additions & 1 deletion api.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ Params Types:
- <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>
- <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>
- <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>
- <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>
- <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>
- <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>
- <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>
Expand Down Expand Up @@ -98,7 +99,7 @@ Methods:

- <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>
- <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>
- <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>
- <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>
- <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>
- <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>
- <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>
Expand Down
6 changes: 3 additions & 3 deletions audiospeech.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,13 @@ const (
type AudioSpeechNewParams struct {
// The text to generate audio for. The maximum length is 4096 characters.
Input param.Field[string] `json:"input,required"`
// One of the available [TTS models](https://platform.openai.com/docs/models/tts):
// One of the available [TTS models](https://platform.openai.com/docs/models#tts):
// `tts-1` or `tts-1-hd`
Model param.Field[SpeechModel] `json:"model,required"`
// The voice to use when generating the audio. Supported voices are `alloy`,
// `echo`, `fable`, `onyx`, `nova`, and `shimmer`. Previews of the voices are
// available in the
// [Text to speech guide](https://platform.openai.com/docs/guides/text-to-speech/voice-options).
// [Text to speech guide](https://platform.openai.com/docs/guides/text-to-speech#voice-options).
Voice param.Field[AudioSpeechNewParamsVoice] `json:"voice,required"`
// The format to audio in. Supported formats are `mp3`, `opus`, `aac`, `flac`,
// `wav`, and `pcm`.
Expand All @@ -73,7 +73,7 @@ func (r AudioSpeechNewParams) MarshalJSON() (data []byte, err error) {
// The voice to use when generating the audio. Supported voices are `alloy`,
// `echo`, `fable`, `onyx`, `nova`, and `shimmer`. Previews of the voices are
// available in the
// [Text to speech guide](https://platform.openai.com/docs/guides/text-to-speech/voice-options).
// [Text to speech guide](https://platform.openai.com/docs/guides/text-to-speech#voice-options).
type AudioSpeechNewParamsVoice string

const (
Expand Down
2 changes: 1 addition & 1 deletion audiotranscription.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ type AudioTranscriptionNewParams struct {
Language param.Field[string] `json:"language"`
// An optional text to guide the model's style or continue a previous audio
// segment. The
// [prompt](https://platform.openai.com/docs/guides/speech-to-text/prompting)
// [prompt](https://platform.openai.com/docs/guides/speech-to-text#prompting)
// should match the audio language.
Prompt param.Field[string] `json:"prompt"`
// The format of the output, in one of these options: `json`, `text`, `srt`,
Expand Down
2 changes: 1 addition & 1 deletion audiotranslation.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ type AudioTranslationNewParams struct {
Model param.Field[AudioModel] `json:"model,required"`
// An optional text to guide the model's style or continue a previous audio
// segment. The
// [prompt](https://platform.openai.com/docs/guides/speech-to-text/prompting)
// [prompt](https://platform.openai.com/docs/guides/speech-to-text#prompting)
// should be in English.
Prompt param.Field[string] `json:"prompt"`
// The format of the output, in one of these options: `json`, `text`, `srt`,
Expand Down
30 changes: 15 additions & 15 deletions betaassistant.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ type Assistant struct {
// ID of the model to use. You can use the
// [List models](https://platform.openai.com/docs/api-reference/models/list) API to
// see all of your available models, or see our
// [Model overview](https://platform.openai.com/docs/models/overview) for
// descriptions of them.
// [Model overview](https://platform.openai.com/docs/models) for descriptions of
// them.
Model string `json:"model,required"`
// The name of the assistant. The maximum length is 256 characters.
Name string `json:"name,required,nullable"`
Expand Down Expand Up @@ -1572,7 +1572,7 @@ func (r AssistantStreamEventThreadMessageIncompleteEvent) IsKnown() bool {
}

// Occurs when an
// [error](https://platform.openai.com/docs/guides/error-codes/api-errors) occurs.
// [error](https://platform.openai.com/docs/guides/error-codes#api-errors) occurs.
// This can happen due to an internal server error or a timeout.
type AssistantStreamEventErrorEvent struct {
Data shared.ErrorObject `json:"data,required"`
Expand Down Expand Up @@ -1867,14 +1867,14 @@ type FileSearchToolFileSearch struct {
//
// Note that the file search tool may output fewer than `max_num_results` results.
// See the
// [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search/customizing-file-search-settings)
// [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings)
// for more information.
MaxNumResults int64 `json:"max_num_results"`
// The ranking options for the file search. If not specified, the file search tool
// will use the `auto` ranker and a score_threshold of 0.
//
// See the
// [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search/customizing-file-search-settings)
// [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings)
// for more information.
RankingOptions FileSearchToolFileSearchRankingOptions `json:"ranking_options"`
JSON fileSearchToolFileSearchJSON `json:"-"`
Expand All @@ -1901,7 +1901,7 @@ func (r fileSearchToolFileSearchJSON) RawJSON() string {
// will use the `auto` ranker and a score_threshold of 0.
//
// See the
// [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search/customizing-file-search-settings)
// [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings)
// for more information.
type FileSearchToolFileSearchRankingOptions struct {
// The score threshold for the file search. All values must be a floating point
Expand Down Expand Up @@ -1970,14 +1970,14 @@ type FileSearchToolFileSearchParam struct {
//
// Note that the file search tool may output fewer than `max_num_results` results.
// See the
// [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search/customizing-file-search-settings)
// [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings)
// for more information.
MaxNumResults param.Field[int64] `json:"max_num_results"`
// The ranking options for the file search. If not specified, the file search tool
// will use the `auto` ranker and a score_threshold of 0.
//
// See the
// [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search/customizing-file-search-settings)
// [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings)
// for more information.
RankingOptions param.Field[FileSearchToolFileSearchRankingOptionsParam] `json:"ranking_options"`
}
Expand All @@ -1990,7 +1990,7 @@ func (r FileSearchToolFileSearchParam) MarshalJSON() (data []byte, err error) {
// will use the `auto` ranker and a score_threshold of 0.
//
// See the
// [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search/customizing-file-search-settings)
// [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings)
// for more information.
type FileSearchToolFileSearchRankingOptionsParam struct {
// The score threshold for the file search. All values must be a floating point
Expand Down Expand Up @@ -2063,8 +2063,8 @@ type BetaAssistantNewParams struct {
// ID of the model to use. You can use the
// [List models](https://platform.openai.com/docs/api-reference/models/list) API to
// see all of your available models, or see our
// [Model overview](https://platform.openai.com/docs/models/overview) for
// descriptions of them.
// [Model overview](https://platform.openai.com/docs/models) for descriptions of
// them.
Model param.Field[ChatModel] `json:"model,required"`
// The description of the assistant. The maximum length is 512 characters.
Description param.Field[string] `json:"description"`
Expand Down Expand Up @@ -2177,8 +2177,8 @@ type BetaAssistantUpdateParams struct {
// ID of the model to use. You can use the
// [List models](https://platform.openai.com/docs/api-reference/models/list) API to
// see all of your available models, or see our
// [Model overview](https://platform.openai.com/docs/models/overview) for
// descriptions of them.
// [Model overview](https://platform.openai.com/docs/models) for descriptions of
// them.
Model param.Field[string] `json:"model"`
// The name of the assistant. The maximum length is 256 characters.
Name param.Field[string] `json:"name"`
Expand Down Expand Up @@ -2252,8 +2252,8 @@ type BetaAssistantListParams struct {
After param.Field[string] `query:"after"`
// A cursor for use in pagination. `before` is an object ID that defines your place
// in the list. For instance, if you make a list request and receive 100 objects,
// ending with obj_foo, your subsequent call can include before=obj_foo in order to
// fetch the previous page of the list.
// starting with obj_foo, your subsequent call can include before=obj_foo in order
// to fetch the previous page of the list.
Before param.Field[string] `query:"before"`
// A limit on the number of objects to be returned. Limit can range between 1 and
// 100, and the default is 20.
Expand Down
6 changes: 3 additions & 3 deletions betathread.go
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ type BetaThreadNewParamsMessage struct {
// An array of content parts with a defined type, each can be of type `text` or
// images can be passed with `image_url` or `image_file`. Image types are only
// supported on
// [Vision-compatible models](https://platform.openai.com/docs/models/overview).
// [Vision-compatible models](https://platform.openai.com/docs/models).
Content param.Field[[]MessageContentPartParamUnion] `json:"content,required"`
// The role of the entity that is creating the message. Allowed values include:
//
Expand Down Expand Up @@ -729,7 +729,7 @@ type BetaThreadNewAndRunParams struct {
// assistant will be used.
Model param.Field[ChatModel] `json:"model"`
// Whether to enable
// [parallel function calling](https://platform.openai.com/docs/guides/function-calling/parallel-function-calling)
// [parallel function calling](https://platform.openai.com/docs/guides/function-calling#configuring-parallel-function-calling)
// during tool use.
ParallelToolCalls param.Field[bool] `json:"parallel_tool_calls"`
// What sampling temperature to use, between 0 and 2. Higher values like 0.8 will
Expand Down Expand Up @@ -794,7 +794,7 @@ type BetaThreadNewAndRunParamsThreadMessage struct {
// An array of content parts with a defined type, each can be of type `text` or
// images can be passed with `image_url` or `image_file`. Image types are only
// supported on
// [Vision-compatible models](https://platform.openai.com/docs/models/overview).
// [Vision-compatible models](https://platform.openai.com/docs/models).
Content param.Field[[]MessageContentPartParamUnion] `json:"content,required"`
// The role of the entity that is creating the message. Allowed values include:
//
Expand Down
6 changes: 3 additions & 3 deletions betathreadmessage.go
Original file line number Diff line number Diff line change
Expand Up @@ -1952,7 +1952,7 @@ type BetaThreadMessageNewParams struct {
// An array of content parts with a defined type, each can be of type `text` or
// images can be passed with `image_url` or `image_file`. Image types are only
// supported on
// [Vision-compatible models](https://platform.openai.com/docs/models/overview).
// [Vision-compatible models](https://platform.openai.com/docs/models).
Content param.Field[[]MessageContentPartParamUnion] `json:"content,required"`
// The role of the entity that is creating the message. Allowed values include:
//
Expand Down Expand Up @@ -2088,8 +2088,8 @@ type BetaThreadMessageListParams struct {
After param.Field[string] `query:"after"`
// A cursor for use in pagination. `before` is an object ID that defines your place
// in the list. For instance, if you make a list request and receive 100 objects,
// ending with obj_foo, your subsequent call can include before=obj_foo in order to
// fetch the previous page of the list.
// starting with obj_foo, your subsequent call can include before=obj_foo in order
// to fetch the previous page of the list.
Before param.Field[string] `query:"before"`
// A limit on the number of objects to be returned. Limit can range between 1 and
// 100, and the default is 20.
Expand Down
Loading

0 comments on commit ab88fa9

Please sign in to comment.