Skip to content

Commit 0bd5821

Browse files
feat(api): remove InputAudio from ResponseInputContent
Removes the type `InputAudio` from `ResponseInputContent`. This parameter was non-functional and has now been removed. Please note that this is not a feature removal; it was never supported by the Responses API. While this is technically a backward-incompatible change due to the type removal, it reflects the intended behavior and has no functional impact.
1 parent 4ab208c commit 0bd5821

File tree

2 files changed

+32
-47
lines changed

2 files changed

+32
-47
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 123
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-a3c45d9bd3bb25bf4eaa49b7fb473a00038293dec659ffaa44f624ded884abf4.yml
3-
openapi_spec_hash: 9c20aaf786a0700dabd13d9865481c9e
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-f68f718cd45ac3f9336603601bccc38a718af44d0b26601031de3d0a71b7ce2f.yml
3+
openapi_spec_hash: 1560717860bba4105936647dde8f618d
44
config_hash: 50ee3382a63c021a9f821a935950e926

responses/response.go

Lines changed: 30 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,8 @@ func (r *ComputerToolParam) UnmarshalJSON(data []byte) error {
223223
return apijson.UnmarshalRoot(data, r)
224224
}
225225

226+
// A custom tool that processes input using a specified format. Learn more about
227+
// [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools)
226228
type CustomTool struct {
227229
// The name of the custom tool, used to identify it in tool calls.
228230
Name string `json:"name,required"`
@@ -258,6 +260,9 @@ func (r CustomTool) ToParam() CustomToolParam {
258260
return param.Override[CustomToolParam](json.RawMessage(r.RawJSON()))
259261
}
260262

263+
// A custom tool that processes input using a specified format. Learn more about
264+
// [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools)
265+
//
261266
// The properties Name, Type are required.
262267
type CustomToolParam struct {
263268
// The name of the custom tool, used to identify it in tool calls.
@@ -5708,16 +5713,15 @@ func (r *ResponseInputAudioInputAudioParam) UnmarshalJSON(data []byte) error {
57085713
}
57095714

57105715
// ResponseInputContentUnion contains all possible properties and values from
5711-
// [ResponseInputText], [ResponseInputImage], [ResponseInputFile],
5712-
// [ResponseInputAudio].
5716+
// [ResponseInputText], [ResponseInputImage], [ResponseInputFile].
57135717
//
57145718
// Use the [ResponseInputContentUnion.AsAny] method to switch on the variant.
57155719
//
57165720
// Use the methods beginning with 'As' to cast the union to one of its variants.
57175721
type ResponseInputContentUnion struct {
57185722
// This field is from variant [ResponseInputText].
57195723
Text string `json:"text"`
5720-
// Any of "input_text", "input_image", "input_file", "input_audio".
5724+
// Any of "input_text", "input_image", "input_file".
57215725
Type string `json:"type"`
57225726
// This field is from variant [ResponseInputImage].
57235727
Detail ResponseInputImageDetail `json:"detail"`
@@ -5730,19 +5734,16 @@ type ResponseInputContentUnion struct {
57305734
FileURL string `json:"file_url"`
57315735
// This field is from variant [ResponseInputFile].
57325736
Filename string `json:"filename"`
5733-
// This field is from variant [ResponseInputAudio].
5734-
InputAudio ResponseInputAudioInputAudio `json:"input_audio"`
5735-
JSON struct {
5736-
Text respjson.Field
5737-
Type respjson.Field
5738-
Detail respjson.Field
5739-
FileID respjson.Field
5740-
ImageURL respjson.Field
5741-
FileData respjson.Field
5742-
FileURL respjson.Field
5743-
Filename respjson.Field
5744-
InputAudio respjson.Field
5745-
raw string
5737+
JSON struct {
5738+
Text respjson.Field
5739+
Type respjson.Field
5740+
Detail respjson.Field
5741+
FileID respjson.Field
5742+
ImageURL respjson.Field
5743+
FileData respjson.Field
5744+
FileURL respjson.Field
5745+
Filename respjson.Field
5746+
raw string
57465747
} `json:"-"`
57475748
}
57485749

@@ -5756,15 +5757,13 @@ type anyResponseInputContent interface {
57565757
func (ResponseInputText) implResponseInputContentUnion() {}
57575758
func (ResponseInputImage) implResponseInputContentUnion() {}
57585759
func (ResponseInputFile) implResponseInputContentUnion() {}
5759-
func (ResponseInputAudio) implResponseInputContentUnion() {}
57605760

57615761
// Use the following switch statement to find the correct variant
57625762
//
57635763
// switch variant := ResponseInputContentUnion.AsAny().(type) {
57645764
// case responses.ResponseInputText:
57655765
// case responses.ResponseInputImage:
57665766
// case responses.ResponseInputFile:
5767-
// case responses.ResponseInputAudio:
57685767
// default:
57695768
// fmt.Errorf("no variant present")
57705769
// }
@@ -5776,8 +5775,6 @@ func (u ResponseInputContentUnion) AsAny() anyResponseInputContent {
57765775
return u.AsInputImage()
57775776
case "input_file":
57785777
return u.AsInputFile()
5779-
case "input_audio":
5780-
return u.AsInputAudio()
57815778
}
57825779
return nil
57835780
}
@@ -5797,11 +5794,6 @@ func (u ResponseInputContentUnion) AsInputFile() (v ResponseInputFile) {
57975794
return
57985795
}
57995796

5800-
func (u ResponseInputContentUnion) AsInputAudio() (v ResponseInputAudio) {
5801-
apijson.UnmarshalRoot(json.RawMessage(u.JSON.raw), &v)
5802-
return
5803-
}
5804-
58055797
// Returns the unmodified JSON received from the API
58065798
func (u ResponseInputContentUnion) RawJSON() string { return u.JSON.raw }
58075799

@@ -5831,25 +5823,18 @@ func ResponseInputContentParamOfInputImage(detail ResponseInputImageDetail) Resp
58315823
return ResponseInputContentUnionParam{OfInputImage: &inputImage}
58325824
}
58335825

5834-
func ResponseInputContentParamOfInputAudio(inputAudio ResponseInputAudioInputAudioParam) ResponseInputContentUnionParam {
5835-
var variant ResponseInputAudioParam
5836-
variant.InputAudio = inputAudio
5837-
return ResponseInputContentUnionParam{OfInputAudio: &variant}
5838-
}
5839-
58405826
// Only one field can be non-zero.
58415827
//
58425828
// Use [param.IsOmitted] to confirm if a field is set.
58435829
type ResponseInputContentUnionParam struct {
58445830
OfInputText *ResponseInputTextParam `json:",omitzero,inline"`
58455831
OfInputImage *ResponseInputImageParam `json:",omitzero,inline"`
58465832
OfInputFile *ResponseInputFileParam `json:",omitzero,inline"`
5847-
OfInputAudio *ResponseInputAudioParam `json:",omitzero,inline"`
58485833
paramUnion
58495834
}
58505835

58515836
func (u ResponseInputContentUnionParam) MarshalJSON() ([]byte, error) {
5852-
return param.MarshalUnion(u, u.OfInputText, u.OfInputImage, u.OfInputFile, u.OfInputAudio)
5837+
return param.MarshalUnion(u, u.OfInputText, u.OfInputImage, u.OfInputFile)
58535838
}
58545839
func (u *ResponseInputContentUnionParam) UnmarshalJSON(data []byte) error {
58555840
return apijson.UnmarshalRoot(data, u)
@@ -5862,8 +5847,6 @@ func (u *ResponseInputContentUnionParam) asAny() any {
58625847
return u.OfInputImage
58635848
} else if !param.IsOmitted(u.OfInputFile) {
58645849
return u.OfInputFile
5865-
} else if !param.IsOmitted(u.OfInputAudio) {
5866-
return u.OfInputAudio
58675850
}
58685851
return nil
58695852
}
@@ -5916,14 +5899,6 @@ func (u ResponseInputContentUnionParam) GetFilename() *string {
59165899
return nil
59175900
}
59185901

5919-
// Returns a pointer to the underlying variant's property, if present.
5920-
func (u ResponseInputContentUnionParam) GetInputAudio() *ResponseInputAudioInputAudioParam {
5921-
if vt := u.OfInputAudio; vt != nil {
5922-
return &vt.InputAudio
5923-
}
5924-
return nil
5925-
}
5926-
59275902
// Returns a pointer to the underlying variant's property, if present.
59285903
func (u ResponseInputContentUnionParam) GetType() *string {
59295904
if vt := u.OfInputText; vt != nil {
@@ -5932,8 +5907,6 @@ func (u ResponseInputContentUnionParam) GetType() *string {
59325907
return (*string)(&vt.Type)
59335908
} else if vt := u.OfInputFile; vt != nil {
59345909
return (*string)(&vt.Type)
5935-
} else if vt := u.OfInputAudio; vt != nil {
5936-
return (*string)(&vt.Type)
59375910
}
59385911
return nil
59395912
}
@@ -5948,6 +5921,15 @@ func (u ResponseInputContentUnionParam) GetFileID() *string {
59485921
return nil
59495922
}
59505923

5924+
func init() {
5925+
apijson.RegisterUnion[ResponseInputContentUnionParam](
5926+
"type",
5927+
apijson.Discriminator[ResponseInputTextParam]("input_text"),
5928+
apijson.Discriminator[ResponseInputImageParam]("input_image"),
5929+
apijson.Discriminator[ResponseInputFileParam]("input_file"),
5930+
)
5931+
}
5932+
59515933
// A file input to the model.
59525934
type ResponseInputFile struct {
59535935
// The type of the input item. Always `input_file`.
@@ -13581,6 +13563,7 @@ func (r *ToolImageGenerationInputImageMask) UnmarshalJSON(data []byte) error {
1358113563
return apijson.UnmarshalRoot(data, r)
1358213564
}
1358313565

13566+
// A tool that allows the model to execute shell commands in a local environment.
1358413567
type ToolLocalShell struct {
1358513568
// The type of the local shell tool. Always `local_shell`.
1358613569
Type constant.LocalShell `json:"type,required"`
@@ -14513,6 +14496,8 @@ func NewToolLocalShellParam() ToolLocalShellParam {
1451314496
}
1451414497
}
1451514498

14499+
// A tool that allows the model to execute shell commands in a local environment.
14500+
//
1451614501
// This struct has a constant value, construct it with [NewToolLocalShellParam].
1451714502
type ToolLocalShellParam struct {
1451814503
// The type of the local shell tool. Always `local_shell`.

0 commit comments

Comments
 (0)