Skip to content

Commit 9bd0845

Browse files
committed
feat(aliases): add new ChatModel constants for GPT-4.1 variants
1 parent c0414f1 commit 9bd0845

File tree

3 files changed

+60
-0
lines changed

3 files changed

+60
-0
lines changed

aliases.go

+18
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,24 @@ const ChatModelO1Mini = shared.ChatModelO1Mini
4444
// Equals "o1-mini-2024-09-12"
4545
const ChatModelO1Mini2024_09_12 = shared.ChatModelO1Mini2024_09_12
4646

47+
// Equals "gpt-4-1"
48+
const ChatModelGPT4_1 = shared.ChatModelGPT4_1
49+
50+
// Equals "gpt-4-1-2025-04-14"
51+
const ChatModelGPT4_1_2025_04_14 = shared.ChatModelGPT4_1_2025_04_14
52+
53+
// Equals "gpt-4-1-mini"
54+
const ChatModelGPT4_1Mini = shared.ChatModelGPT4_1Mini
55+
56+
// Equals "gpt-4-1-mini-2025-04-14"
57+
const ChatModelGPT4_1Mini_2025_04_14 = shared.ChatModelGPT4_1Mini_2025_04_14
58+
59+
// Equals "gpt-4-1-nano"
60+
const ChatModelGPT4_1Nano = shared.ChatModelGPT4_1Nano
61+
62+
// Equals "gpt-4-1-nano-2025-04-14"
63+
const ChatModelGPT4_1Nano_2025_04_14 = shared.ChatModelGPT4_1Nano_2025_04_14
64+
4765
// Equals "gpt-4o"
4866
const ChatModelGPT4o = shared.ChatModelGPT4o
4967

responses/aliases.go

+18
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,24 @@ const ChatModelO1Mini = shared.ChatModelO1Mini
4444
// Equals "o1-mini-2024-09-12"
4545
const ChatModelO1Mini2024_09_12 = shared.ChatModelO1Mini2024_09_12
4646

47+
// Equals "gpt-4-1"
48+
const ChatModelGPT4_1 = shared.ChatModelGPT4_1
49+
50+
// Equals "gpt-4-1-2025-04-14"
51+
const ChatModelGPT4_1_2025_04_14 = shared.ChatModelGPT4_1_2025_04_14
52+
53+
// Equals "gpt-4-1-mini"
54+
const ChatModelGPT4_1Mini = shared.ChatModelGPT4_1Mini
55+
56+
// Equals "gpt-4-1-mini-2025-04-14"
57+
const ChatModelGPT4_1Mini_2025_04_14 = shared.ChatModelGPT4_1Mini_2025_04_14
58+
59+
// Equals "gpt-4-1-nano"
60+
const ChatModelGPT4_1Nano = shared.ChatModelGPT4_1Nano
61+
62+
// Equals "gpt-4-1-nano-2025-04-14"
63+
const ChatModelGPT4_1Nano_2025_04_14 = shared.ChatModelGPT4_1Nano_2025_04_14
64+
4765
// Equals "gpt-4o"
4866
const ChatModelGPT4o = shared.ChatModelGPT4o
4967

shared/shared.go

+24
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ const (
2828
ChatModelO1Preview2024_09_12 ChatModel = "o1-preview-2024-09-12"
2929
ChatModelO1Mini ChatModel = "o1-mini"
3030
ChatModelO1Mini2024_09_12 ChatModel = "o1-mini-2024-09-12"
31+
ChatModelGPT4_1 ChatModel = "gpt-4.1"
32+
ChatModelGPT4_1_2025_04_14 ChatModel = "gpt-4.1-2025-04-14"
33+
ChatModelGPT4_1Mini ChatModel = "gpt-4.1-mini"
34+
ChatModelGPT4_1Mini_2025_04_14 ChatModel = "gpt-4.1-mini-2025-04-14"
35+
ChatModelGPT4_1Nano ChatModel = "gpt-4.1-nano"
36+
ChatModelGPT4_1Nano_2025_04_14 ChatModel = "gpt-4.1-nano-2025-04-14"
3137
ChatModelGPT4o ChatModel = "gpt-4o"
3238
ChatModelGPT4o2024_11_20 ChatModel = "gpt-4o-2024-11-20"
3339
ChatModelGPT4o2024_08_06 ChatModel = "gpt-4o-2024-08-06"
@@ -97,6 +103,7 @@ type ComparisonFilter struct {
97103

98104
// Returns the unmodified JSON received from the API
99105
func (r ComparisonFilter) RawJSON() string { return r.JSON.raw }
106+
100107
func (r *ComparisonFilter) UnmarshalJSON(data []byte) error {
101108
return apijson.UnmarshalRoot(data, r)
102109
}
@@ -200,6 +207,7 @@ type ComparisonFilterParam struct {
200207
// IsPresent returns true if the field's value is not omitted and not the JSON
201208
// "null". To check if this field is omitted, use [param.IsOmitted].
202209
func (f ComparisonFilterParam) IsPresent() bool { return !param.IsOmitted(f) && !f.IsNull() }
210+
203211
func (r ComparisonFilterParam) MarshalJSON() (data []byte, err error) {
204212
type shadow ComparisonFilterParam
205213
return param.MarshalObject(r, (*shadow)(&r))
@@ -218,6 +226,7 @@ type ComparisonFilterValueUnionParam struct {
218226
// IsPresent returns true if the field's value is not omitted and not the JSON
219227
// "null". To check if this field is omitted, use [param.IsOmitted].
220228
func (u ComparisonFilterValueUnionParam) IsPresent() bool { return !param.IsOmitted(u) && !u.IsNull() }
229+
221230
func (u ComparisonFilterValueUnionParam) MarshalJSON() ([]byte, error) {
222231
return param.MarshalUnion[ComparisonFilterValueUnionParam](u.OfString, u.OfFloat, u.OfBool)
223232
}
@@ -254,6 +263,7 @@ type CompoundFilter struct {
254263

255264
// Returns the unmodified JSON received from the API
256265
func (r CompoundFilter) RawJSON() string { return r.JSON.raw }
266+
257267
func (r *CompoundFilter) UnmarshalJSON(data []byte) error {
258268
return apijson.UnmarshalRoot(data, r)
259269
}
@@ -292,6 +302,7 @@ type CompoundFilterParam struct {
292302
// IsPresent returns true if the field's value is not omitted and not the JSON
293303
// "null". To check if this field is omitted, use [param.IsOmitted].
294304
func (f CompoundFilterParam) IsPresent() bool { return !param.IsOmitted(f) && !f.IsNull() }
305+
295306
func (r CompoundFilterParam) MarshalJSON() (data []byte, err error) {
296307
type shadow CompoundFilterParam
297308
return param.MarshalObject(r, (*shadow)(&r))
@@ -316,6 +327,7 @@ type ErrorObject struct {
316327

317328
// Returns the unmodified JSON received from the API
318329
func (r ErrorObject) RawJSON() string { return r.JSON.raw }
330+
319331
func (r *ErrorObject) UnmarshalJSON(data []byte) error {
320332
return apijson.UnmarshalRoot(data, r)
321333
}
@@ -355,6 +367,7 @@ type FunctionDefinition struct {
355367

356368
// Returns the unmodified JSON received from the API
357369
func (r FunctionDefinition) RawJSON() string { return r.JSON.raw }
370+
358371
func (r *FunctionDefinition) UnmarshalJSON(data []byte) error {
359372
return apijson.UnmarshalRoot(data, r)
360373
}
@@ -396,6 +409,7 @@ type FunctionDefinitionParam struct {
396409
// IsPresent returns true if the field's value is not omitted and not the JSON
397410
// "null". To check if this field is omitted, use [param.IsOmitted].
398411
func (f FunctionDefinitionParam) IsPresent() bool { return !param.IsOmitted(f) && !f.IsNull() }
412+
399413
func (r FunctionDefinitionParam) MarshalJSON() (data []byte, err error) {
400414
type shadow FunctionDefinitionParam
401415
return param.MarshalObject(r, (*shadow)(&r))
@@ -441,6 +455,7 @@ type Reasoning struct {
441455

442456
// Returns the unmodified JSON received from the API
443457
func (r Reasoning) RawJSON() string { return r.JSON.raw }
458+
444459
func (r *Reasoning) UnmarshalJSON(data []byte) error {
445460
return apijson.UnmarshalRoot(data, r)
446461
}
@@ -494,6 +509,7 @@ type ReasoningParam struct {
494509
// IsPresent returns true if the field's value is not omitted and not the JSON
495510
// "null". To check if this field is omitted, use [param.IsOmitted].
496511
func (f ReasoningParam) IsPresent() bool { return !param.IsOmitted(f) && !f.IsNull() }
512+
497513
func (r ReasoningParam) MarshalJSON() (data []byte, err error) {
498514
type shadow ReasoningParam
499515
return param.MarshalObject(r, (*shadow)(&r))
@@ -530,6 +546,7 @@ type ResponseFormatJSONObject struct {
530546

531547
// Returns the unmodified JSON received from the API
532548
func (r ResponseFormatJSONObject) RawJSON() string { return r.JSON.raw }
549+
533550
func (r *ResponseFormatJSONObject) UnmarshalJSON(data []byte) error {
534551
return apijson.UnmarshalRoot(data, r)
535552
}
@@ -562,6 +579,7 @@ type ResponseFormatJSONObjectParam struct {
562579
// IsPresent returns true if the field's value is not omitted and not the JSON
563580
// "null". To check if this field is omitted, use [param.IsOmitted].
564581
func (f ResponseFormatJSONObjectParam) IsPresent() bool { return !param.IsOmitted(f) && !f.IsNull() }
582+
565583
func (r ResponseFormatJSONObjectParam) MarshalJSON() (data []byte, err error) {
566584
type shadow ResponseFormatJSONObjectParam
567585
return param.MarshalObject(r, (*shadow)(&r))
@@ -587,6 +605,7 @@ type ResponseFormatJSONSchema struct {
587605

588606
// Returns the unmodified JSON received from the API
589607
func (r ResponseFormatJSONSchema) RawJSON() string { return r.JSON.raw }
608+
590609
func (r *ResponseFormatJSONSchema) UnmarshalJSON(data []byte) error {
591610
return apijson.UnmarshalRoot(data, r)
592611
}
@@ -632,6 +651,7 @@ type ResponseFormatJSONSchemaJSONSchema struct {
632651

633652
// Returns the unmodified JSON received from the API
634653
func (r ResponseFormatJSONSchemaJSONSchema) RawJSON() string { return r.JSON.raw }
654+
635655
func (r *ResponseFormatJSONSchemaJSONSchema) UnmarshalJSON(data []byte) error {
636656
return apijson.UnmarshalRoot(data, r)
637657
}
@@ -654,6 +674,7 @@ type ResponseFormatJSONSchemaParam struct {
654674
// IsPresent returns true if the field's value is not omitted and not the JSON
655675
// "null". To check if this field is omitted, use [param.IsOmitted].
656676
func (f ResponseFormatJSONSchemaParam) IsPresent() bool { return !param.IsOmitted(f) && !f.IsNull() }
677+
657678
func (r ResponseFormatJSONSchemaParam) MarshalJSON() (data []byte, err error) {
658679
type shadow ResponseFormatJSONSchemaParam
659680
return param.MarshalObject(r, (*shadow)(&r))
@@ -686,6 +707,7 @@ type ResponseFormatJSONSchemaJSONSchemaParam struct {
686707
func (f ResponseFormatJSONSchemaJSONSchemaParam) IsPresent() bool {
687708
return !param.IsOmitted(f) && !f.IsNull()
688709
}
710+
689711
func (r ResponseFormatJSONSchemaJSONSchemaParam) MarshalJSON() (data []byte, err error) {
690712
type shadow ResponseFormatJSONSchemaJSONSchemaParam
691713
return param.MarshalObject(r, (*shadow)(&r))
@@ -706,6 +728,7 @@ type ResponseFormatText struct {
706728

707729
// Returns the unmodified JSON received from the API
708730
func (r ResponseFormatText) RawJSON() string { return r.JSON.raw }
731+
709732
func (r *ResponseFormatText) UnmarshalJSON(data []byte) error {
710733
return apijson.UnmarshalRoot(data, r)
711734
}
@@ -735,6 +758,7 @@ type ResponseFormatTextParam struct {
735758
// IsPresent returns true if the field's value is not omitted and not the JSON
736759
// "null". To check if this field is omitted, use [param.IsOmitted].
737760
func (f ResponseFormatTextParam) IsPresent() bool { return !param.IsOmitted(f) && !f.IsNull() }
761+
738762
func (r ResponseFormatTextParam) MarshalJSON() (data []byte, err error) {
739763
type shadow ResponseFormatTextParam
740764
return param.MarshalObject(r, (*shadow)(&r))

0 commit comments

Comments
 (0)