Skip to content

Commit a858292

Browse files
authored
feat: support gpt-4o-2024-11-20 (#1941)
1 parent ff589b5 commit a858292

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

relay/adaptor/openai/constants.go

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ var ModelList = []string{
99
"gpt-4-turbo-preview", "gpt-4-turbo", "gpt-4-turbo-2024-04-09",
1010
"gpt-4o", "gpt-4o-2024-05-13",
1111
"gpt-4o-2024-08-06",
12+
"gpt-4o-2024-11-20",
1213
"chatgpt-4o-latest",
1314
"gpt-4o-mini", "gpt-4o-mini-2024-07-18",
1415
"gpt-4-vision-preview",

relay/billing/ratio/model.go

+5-2
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ var ModelRatio = map[string]float64{
3737
"chatgpt-4o-latest": 2.5, // $0.005 / 1K tokens
3838
"gpt-4o-2024-05-13": 2.5, // $0.005 / 1K tokens
3939
"gpt-4o-2024-08-06": 1.25, // $0.0025 / 1K tokens
40+
"gpt-4o-2024-11-20": 1.25, // $0.0025 / 1K tokens
4041
"gpt-4o-mini": 0.075, // $0.00015 / 1K tokens
4142
"gpt-4o-mini-2024-07-18": 0.075, // $0.00015 / 1K tokens
4243
"gpt-4-vision-preview": 5, // $0.01 / 1K tokens
@@ -453,11 +454,13 @@ func GetCompletionRatio(name string, channelType int) float64 {
453454
return 4.0 / 3.0
454455
}
455456
if strings.HasPrefix(name, "gpt-4") {
456-
if strings.HasPrefix(name, "gpt-4o-mini") || name == "gpt-4o-2024-08-06" {
457+
if strings.HasPrefix(name, "gpt-4o") {
458+
if name == "gpt-4o-2024-05-13" {
459+
return 3
460+
}
457461
return 4
458462
}
459463
if strings.HasPrefix(name, "gpt-4-turbo") ||
460-
strings.HasPrefix(name, "gpt-4o") ||
461464
strings.HasSuffix(name, "preview") {
462465
return 3
463466
}

0 commit comments

Comments
 (0)