@@ -577,8 +577,8 @@ type Response struct {
577
577
// context.
578
578
//
579
579
// When using along with `previous_response_id`, the instructions from a previous
580
- // response will be not be carried over to the next response. This makes it simple
581
- // to swap out system (or developer) messages in new responses.
580
+ // response will not be carried over to the next response. This makes it simple to
581
+ // swap out system (or developer) messages in new responses.
582
582
Instructions string `json:"instructions,required"`
583
583
// Set of 16 key-value pairs that can be attached to an object. This can be useful
584
584
// for storing additional information about the object in a structured format, and
@@ -2971,18 +2971,18 @@ type ResponseFormatTextConfigUnion struct {
2971
2971
// Any of "text", "json_schema", "json_object".
2972
2972
Type string `json:"type"`
2973
2973
// This field is from variant [ResponseFormatTextJSONSchemaConfig].
2974
+ Name string `json:"name"`
2975
+ // This field is from variant [ResponseFormatTextJSONSchemaConfig].
2974
2976
Schema map [string ]interface {} `json:"schema"`
2975
2977
// This field is from variant [ResponseFormatTextJSONSchemaConfig].
2976
2978
Description string `json:"description"`
2977
2979
// This field is from variant [ResponseFormatTextJSONSchemaConfig].
2978
- Name string `json:"name"`
2979
- // This field is from variant [ResponseFormatTextJSONSchemaConfig].
2980
2980
Strict bool `json:"strict"`
2981
2981
JSON struct {
2982
2982
Type resp.Field
2983
+ Name resp.Field
2983
2984
Schema resp.Field
2984
2985
Description resp.Field
2985
- Name resp.Field
2986
2986
Strict resp.Field
2987
2987
raw string
2988
2988
} `json:"-"`
@@ -3041,8 +3041,9 @@ func (r ResponseFormatTextConfigUnion) ToParam() ResponseFormatTextConfigUnionPa
3041
3041
return param.OverrideObj [ResponseFormatTextConfigUnionParam ](r .RawJSON ())
3042
3042
}
3043
3043
3044
- func ResponseFormatTextConfigParamOfJSONSchema (schema map [string ]interface {}) ResponseFormatTextConfigUnionParam {
3044
+ func ResponseFormatTextConfigParamOfJSONSchema (name string , schema map [string ]interface {}) ResponseFormatTextConfigUnionParam {
3045
3045
var jsonSchema ResponseFormatTextJSONSchemaConfigParam
3046
+ jsonSchema .Name = name
3046
3047
jsonSchema .Schema = schema
3047
3048
return ResponseFormatTextConfigUnionParam {OfJSONSchema : & jsonSchema }
3048
3049
}
@@ -3078,25 +3079,25 @@ func (u *ResponseFormatTextConfigUnionParam) asAny() any {
3078
3079
}
3079
3080
3080
3081
// Returns a pointer to the underlying variant's property, if present.
3081
- func (u ResponseFormatTextConfigUnionParam ) GetSchema () map [ string ] interface {} {
3082
+ func (u ResponseFormatTextConfigUnionParam ) GetName () * string {
3082
3083
if vt := u .OfJSONSchema ; vt != nil {
3083
- return vt .Schema
3084
+ return & vt .Name
3084
3085
}
3085
3086
return nil
3086
3087
}
3087
3088
3088
3089
// Returns a pointer to the underlying variant's property, if present.
3089
- func (u ResponseFormatTextConfigUnionParam ) GetDescription () * string {
3090
- if vt := u .OfJSONSchema ; vt != nil && vt . Description . IsPresent () {
3091
- return & vt .Description . Value
3090
+ func (u ResponseFormatTextConfigUnionParam ) GetSchema () map [ string ] interface {} {
3091
+ if vt := u .OfJSONSchema ; vt != nil {
3092
+ return vt .Schema
3092
3093
}
3093
3094
return nil
3094
3095
}
3095
3096
3096
3097
// Returns a pointer to the underlying variant's property, if present.
3097
- func (u ResponseFormatTextConfigUnionParam ) GetName () * string {
3098
- if vt := u .OfJSONSchema ; vt != nil && vt .Name .IsPresent () {
3099
- return & vt .Name .Value
3098
+ func (u ResponseFormatTextConfigUnionParam ) GetDescription () * string {
3099
+ if vt := u .OfJSONSchema ; vt != nil && vt .Description .IsPresent () {
3100
+ return & vt .Description .Value
3100
3101
}
3101
3102
return nil
3102
3103
}
@@ -3146,6 +3147,9 @@ func init() {
3146
3147
// more about
3147
3148
// [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs).
3148
3149
type ResponseFormatTextJSONSchemaConfig struct {
3150
+ // The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores
3151
+ // and dashes, with a maximum length of 64.
3152
+ Name string `json:"name,required"`
3149
3153
// The schema for the response format, described as a JSON Schema object. Learn how
3150
3154
// to build JSON schemas [here](https://json-schema.org/).
3151
3155
Schema map [string ]interface {} `json:"schema,required"`
@@ -3154,9 +3158,6 @@ type ResponseFormatTextJSONSchemaConfig struct {
3154
3158
// A description of what the response format is for, used by the model to determine
3155
3159
// how to respond in the format.
3156
3160
Description string `json:"description"`
3157
- // The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores
3158
- // and dashes, with a maximum length of 64.
3159
- Name string `json:"name"`
3160
3161
// Whether to enable strict schema adherence when generating the output. If set to
3161
3162
// true, the model will always follow the exact schema defined in the `schema`
3162
3163
// field. Only a subset of JSON Schema is supported when `strict` is `true`. To
@@ -3166,10 +3167,10 @@ type ResponseFormatTextJSONSchemaConfig struct {
3166
3167
// Metadata for the response, check the presence of optional fields with the
3167
3168
// [resp.Field.IsPresent] method.
3168
3169
JSON struct {
3170
+ Name resp.Field
3169
3171
Schema resp.Field
3170
3172
Type resp.Field
3171
3173
Description resp.Field
3172
- Name resp.Field
3173
3174
Strict resp.Field
3174
3175
ExtraFields map [string ]resp.Field
3175
3176
raw string
@@ -3196,8 +3197,11 @@ func (r ResponseFormatTextJSONSchemaConfig) ToParam() ResponseFormatTextJSONSche
3196
3197
// more about
3197
3198
// [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs).
3198
3199
//
3199
- // The properties Schema, Type are required.
3200
+ // The properties Name, Schema, Type are required.
3200
3201
type ResponseFormatTextJSONSchemaConfigParam struct {
3202
+ // The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores
3203
+ // and dashes, with a maximum length of 64.
3204
+ Name string `json:"name,required"`
3201
3205
// The schema for the response format, described as a JSON Schema object. Learn how
3202
3206
// to build JSON schemas [here](https://json-schema.org/).
3203
3207
Schema map [string ]interface {} `json:"schema,omitzero,required"`
@@ -3210,9 +3214,6 @@ type ResponseFormatTextJSONSchemaConfigParam struct {
3210
3214
// A description of what the response format is for, used by the model to determine
3211
3215
// how to respond in the format.
3212
3216
Description param.Opt [string ] `json:"description,omitzero"`
3213
- // The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores
3214
- // and dashes, with a maximum length of 64.
3215
- Name param.Opt [string ] `json:"name,omitzero"`
3216
3217
// The type of response format being defined. Always `json_schema`.
3217
3218
//
3218
3219
// This field can be elided, and will marshal its zero value as "json_schema".
@@ -7438,8 +7439,8 @@ type ResponseNewParams struct {
7438
7439
// context.
7439
7440
//
7440
7441
// When using along with `previous_response_id`, the instructions from a previous
7441
- // response will be not be carried over to the next response. This makes it simple
7442
- // to swap out system (or developer) messages in new responses.
7442
+ // response will not be carried over to the next response. This makes it simple to
7443
+ // swap out system (or developer) messages in new responses.
7443
7444
Instructions param.Opt [string ] `json:"instructions,omitzero"`
7444
7445
// An upper bound for the number of tokens that can be generated for a response,
7445
7446
// including visible output tokens and
0 commit comments