mirror of
https://github.com/router-for-me/CLIProxyAPI.git
synced 2026-02-03 04:50:52 +08:00
fix(openai): forward reasoning.effort value
Drop the hardcoded effort mapping in request conversion so unknown values are preserved instead of being coerced to `auto
This commit is contained in:
@@ -2,6 +2,7 @@ package responses
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/tidwall/gjson"
|
"github.com/tidwall/gjson"
|
||||||
"github.com/tidwall/sjson"
|
"github.com/tidwall/sjson"
|
||||||
@@ -189,23 +190,9 @@ func ConvertOpenAIResponsesRequestToOpenAIChatCompletions(modelName string, inpu
|
|||||||
}
|
}
|
||||||
|
|
||||||
if reasoningEffort := root.Get("reasoning.effort"); reasoningEffort.Exists() {
|
if reasoningEffort := root.Get("reasoning.effort"); reasoningEffort.Exists() {
|
||||||
switch reasoningEffort.String() {
|
effort := strings.ToLower(strings.TrimSpace(reasoningEffort.String()))
|
||||||
case "none":
|
if effort != "" {
|
||||||
out, _ = sjson.Set(out, "reasoning_effort", "none")
|
out, _ = sjson.Set(out, "reasoning_effort", effort)
|
||||||
case "auto":
|
|
||||||
out, _ = sjson.Set(out, "reasoning_effort", "auto")
|
|
||||||
case "minimal":
|
|
||||||
out, _ = sjson.Set(out, "reasoning_effort", "minimal")
|
|
||||||
case "low":
|
|
||||||
out, _ = sjson.Set(out, "reasoning_effort", "low")
|
|
||||||
case "medium":
|
|
||||||
out, _ = sjson.Set(out, "reasoning_effort", "medium")
|
|
||||||
case "high":
|
|
||||||
out, _ = sjson.Set(out, "reasoning_effort", "high")
|
|
||||||
case "xhigh":
|
|
||||||
out, _ = sjson.Set(out, "reasoning_effort", "xhigh")
|
|
||||||
default:
|
|
||||||
out, _ = sjson.Set(out, "reasoning_effort", "auto")
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user