Merge pull request #4414 from jingx8885/codex/fix-gpt-55-completion-ratio
fix: correct gpt-5.5 completion ratio
This commit is contained in:
@@ -515,6 +515,9 @@ func getHardcodedCompletionModelRatio(name string) (float64, bool) {
|
|||||||
}
|
}
|
||||||
// gpt-5 匹配
|
// gpt-5 匹配
|
||||||
if strings.HasPrefix(name, "gpt-5") {
|
if strings.HasPrefix(name, "gpt-5") {
|
||||||
|
if strings.HasPrefix(name, "gpt-5.5") {
|
||||||
|
return 6, true
|
||||||
|
}
|
||||||
if strings.HasPrefix(name, "gpt-5.4") {
|
if strings.HasPrefix(name, "gpt-5.4") {
|
||||||
if strings.HasPrefix(name, "gpt-5.4-nano") {
|
if strings.HasPrefix(name, "gpt-5.4-nano") {
|
||||||
return 6.25, true
|
return 6.25, true
|
||||||
|
|||||||
@@ -0,0 +1,22 @@
|
|||||||
|
package ratio_setting
|
||||||
|
|
||||||
|
import "testing"
|
||||||
|
|
||||||
|
func TestGetCompletionRatioInfoGPT55UsesOfficialOutputMultiplier(t *testing.T) {
|
||||||
|
info := GetCompletionRatioInfo("gpt-5.5")
|
||||||
|
|
||||||
|
if info.Ratio != 6 {
|
||||||
|
t.Fatalf("gpt-5.5 completion ratio = %v, want 6", info.Ratio)
|
||||||
|
}
|
||||||
|
if !info.Locked {
|
||||||
|
t.Fatal("gpt-5.5 completion ratio should be locked to the official multiplier")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestGetCompletionRatioGPT55DatedVariant(t *testing.T) {
|
||||||
|
got := GetCompletionRatio("gpt-5.5-2026-04-24")
|
||||||
|
|
||||||
|
if got != 6 {
|
||||||
|
t.Fatalf("gpt-5.5 dated variant completion ratio = %v, want 6", got)
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user