fix(openai): keep xhigh normalization scoped to messages
This commit is contained in:
@@ -4,7 +4,6 @@ package service
|
|||||||
// forwarding. Group-level default mapping only applies when the account itself
|
// forwarding. Group-level default mapping only applies when the account itself
|
||||||
// did not match any explicit model_mapping rule.
|
// did not match any explicit model_mapping rule.
|
||||||
func resolveOpenAIForwardModel(account *Account, requestedModel, defaultMappedModel string) string {
|
func resolveOpenAIForwardModel(account *Account, requestedModel, defaultMappedModel string) string {
|
||||||
requestedModel = NormalizeOpenAICompatRequestedModel(requestedModel)
|
|
||||||
if account == nil {
|
if account == nil {
|
||||||
if defaultMappedModel != "" {
|
if defaultMappedModel != "" {
|
||||||
return defaultMappedModel
|
return defaultMappedModel
|
||||||
|
|||||||
@@ -58,19 +58,6 @@ func TestResolveOpenAIForwardModel(t *testing.T) {
|
|||||||
defaultMappedModel: "gpt-4o-mini",
|
defaultMappedModel: "gpt-4o-mini",
|
||||||
expectedModel: "gpt-5.4",
|
expectedModel: "gpt-5.4",
|
||||||
},
|
},
|
||||||
{
|
|
||||||
name: "normalizes gpt reasoning alias before passthrough mapping",
|
|
||||||
account: &Account{
|
|
||||||
Credentials: map[string]any{
|
|
||||||
"model_mapping": map[string]any{
|
|
||||||
"gpt-5.4": "gpt-5.4",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
requestedModel: "gpt-5.4-xhigh",
|
|
||||||
defaultMappedModel: "gpt-5.1",
|
|
||||||
expectedModel: "gpt-5.4",
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, tt := range tests {
|
for _, tt := range tests {
|
||||||
|
|||||||
Reference in New Issue
Block a user