@@ -576,8 +576,8 @@ type Response struct {
576
576
// context.
577
577
//
578
578
// When using along with `previous_response_id`, the instructions from a previous
579
- // response will be not be carried over to the next response. This makes it simple
580
- // to swap out system (or developer) messages in new responses.
579
+ // response will not be carried over to the next response. This makes it simple to
580
+ // swap out system (or developer) messages in new responses.
581
581
Instructions string `json:"instructions,required"`
582
582
// Set of 16 key-value pairs that can be attached to an object. This can be useful
583
583
// for storing additional information about the object in a structured format, and
@@ -2958,18 +2958,18 @@ type ResponseFormatTextConfigUnion struct {
2958
2958
// Any of "text", "json_schema", "json_object".
2959
2959
Type string `json:"type"`
2960
2960
// This field is from variant [ResponseFormatTextJSONSchemaConfig].
2961
+ Name string `json:"name"`
2962
+ // This field is from variant [ResponseFormatTextJSONSchemaConfig].
2961
2963
Schema map [string ]interface {} `json:"schema"`
2962
2964
// This field is from variant [ResponseFormatTextJSONSchemaConfig].
2963
2965
Description string `json:"description"`
2964
2966
// This field is from variant [ResponseFormatTextJSONSchemaConfig].
2965
- Name string `json:"name"`
2966
- // This field is from variant [ResponseFormatTextJSONSchemaConfig].
2967
2967
Strict bool `json:"strict"`
2968
2968
JSON struct {
2969
2969
Type resp.Field
2970
+ Name resp.Field
2970
2971
Schema resp.Field
2971
2972
Description resp.Field
2972
- Name resp.Field
2973
2973
Strict resp.Field
2974
2974
raw string
2975
2975
} `json:"-"`
@@ -3028,8 +3028,9 @@ func (r ResponseFormatTextConfigUnion) ToParam() ResponseFormatTextConfigUnionPa
3028
3028
return param.OverrideObj [ResponseFormatTextConfigUnionParam ](r .RawJSON ())
3029
3029
}
3030
3030
3031
- func ResponseFormatTextConfigParamOfJSONSchema (schema map [string ]interface {}) ResponseFormatTextConfigUnionParam {
3031
+ func ResponseFormatTextConfigParamOfJSONSchema (name string , schema map [string ]interface {}) ResponseFormatTextConfigUnionParam {
3032
3032
var jsonSchema ResponseFormatTextJSONSchemaConfigParam
3033
+ jsonSchema .Name = name
3033
3034
jsonSchema .Schema = schema
3034
3035
return ResponseFormatTextConfigUnionParam {OfJSONSchema : & jsonSchema }
3035
3036
}
@@ -3065,25 +3066,25 @@ func (u *ResponseFormatTextConfigUnionParam) asAny() any {
3065
3066
}
3066
3067
3067
3068
// Returns a pointer to the underlying variant's property, if present.
3068
- func (u ResponseFormatTextConfigUnionParam ) GetSchema () map [ string ] interface {} {
3069
+ func (u ResponseFormatTextConfigUnionParam ) GetName () * string {
3069
3070
if vt := u .OfJSONSchema ; vt != nil {
3070
- return vt .Schema
3071
+ return & vt .Name
3071
3072
}
3072
3073
return nil
3073
3074
}
3074
3075
3075
3076
// Returns a pointer to the underlying variant's property, if present.
3076
- func (u ResponseFormatTextConfigUnionParam ) GetDescription () * string {
3077
- if vt := u .OfJSONSchema ; vt != nil && vt . Description . IsPresent () {
3078
- return & vt .Description . Value
3077
+ func (u ResponseFormatTextConfigUnionParam ) GetSchema () map [ string ] interface {} {
3078
+ if vt := u .OfJSONSchema ; vt != nil {
3079
+ return vt .Schema
3079
3080
}
3080
3081
return nil
3081
3082
}
3082
3083
3083
3084
// Returns a pointer to the underlying variant's property, if present.
3084
- func (u ResponseFormatTextConfigUnionParam ) GetName () * string {
3085
- if vt := u .OfJSONSchema ; vt != nil && vt .Name .IsPresent () {
3086
- return & vt .Name .Value
3085
+ func (u ResponseFormatTextConfigUnionParam ) GetDescription () * string {
3086
+ if vt := u .OfJSONSchema ; vt != nil && vt .Description .IsPresent () {
3087
+ return & vt .Description .Value
3087
3088
}
3088
3089
return nil
3089
3090
}
@@ -3133,6 +3134,9 @@ func init() {
3133
3134
// more about
3134
3135
// [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs).
3135
3136
type ResponseFormatTextJSONSchemaConfig struct {
3137
+ // The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores
3138
+ // and dashes, with a maximum length of 64.
3139
+ Name string `json:"name,required"`
3136
3140
// The schema for the response format, described as a JSON Schema object. Learn how
3137
3141
// to build JSON schemas [here](https://json-schema.org/).
3138
3142
Schema map [string ]interface {} `json:"schema,required"`
@@ -3141,9 +3145,6 @@ type ResponseFormatTextJSONSchemaConfig struct {
3141
3145
// A description of what the response format is for, used by the model to determine
3142
3146
// how to respond in the format.
3143
3147
Description string `json:"description"`
3144
- // The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores
3145
- // and dashes, with a maximum length of 64.
3146
- Name string `json:"name"`
3147
3148
// Whether to enable strict schema adherence when generating the output. If set to
3148
3149
// true, the model will always follow the exact schema defined in the `schema`
3149
3150
// field. Only a subset of JSON Schema is supported when `strict` is `true`. To
@@ -3153,10 +3154,10 @@ type ResponseFormatTextJSONSchemaConfig struct {
3153
3154
// Metadata for the response, check the presence of optional fields with the
3154
3155
// [resp.Field.IsPresent] method.
3155
3156
JSON struct {
3157
+ Name resp.Field
3156
3158
Schema resp.Field
3157
3159
Type resp.Field
3158
3160
Description resp.Field
3159
- Name resp.Field
3160
3161
Strict resp.Field
3161
3162
ExtraFields map [string ]resp.Field
3162
3163
raw string
@@ -3183,8 +3184,11 @@ func (r ResponseFormatTextJSONSchemaConfig) ToParam() ResponseFormatTextJSONSche
3183
3184
// more about
3184
3185
// [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs).
3185
3186
//
3186
- // The properties Schema, Type are required.
3187
+ // The properties Name, Schema, Type are required.
3187
3188
type ResponseFormatTextJSONSchemaConfigParam struct {
3189
+ // The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores
3190
+ // and dashes, with a maximum length of 64.
3191
+ Name string `json:"name,required"`
3188
3192
// The schema for the response format, described as a JSON Schema object. Learn how
3189
3193
// to build JSON schemas [here](https://json-schema.org/).
3190
3194
Schema map [string ]interface {} `json:"schema,omitzero,required"`
@@ -3197,9 +3201,6 @@ type ResponseFormatTextJSONSchemaConfigParam struct {
3197
3201
// A description of what the response format is for, used by the model to determine
3198
3202
// how to respond in the format.
3199
3203
Description param.Opt [string ] `json:"description,omitzero"`
3200
- // The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores
3201
- // and dashes, with a maximum length of 64.
3202
- Name param.Opt [string ] `json:"name,omitzero"`
3203
3204
// The type of response format being defined. Always `json_schema`.
3204
3205
//
3205
3206
// This field can be elided, and will marshal its zero value as "json_schema".
@@ -7425,8 +7426,8 @@ type ResponseNewParams struct {
7425
7426
// context.
7426
7427
//
7427
7428
// When using along with `previous_response_id`, the instructions from a previous
7428
- // response will be not be carried over to the next response. This makes it simple
7429
- // to swap out system (or developer) messages in new responses.
7429
+ // response will not be carried over to the next response. This makes it simple to
7430
+ // swap out system (or developer) messages in new responses.
7430
7431
Instructions param.Opt [string ] `json:"instructions,omitzero"`
7431
7432
// An upper bound for the number of tokens that can be generated for a response,
7432
7433
// including visible output tokens and
0 commit comments