fix(translator): consolidate temperature and top_p conditionals in OpenAI Claude request

Fixed: #169

fix(translator): adjust instruction strings in Codex Claude and OpenAI responses
This commit is contained in:
Luis Pater
2025-11-01 15:28:20 +08:00
parent 4d0804687c
commit fd2b23592e
3 changed files with 5 additions and 8 deletions

View File

@@ -34,10 +34,7 @@ func ConvertClaudeRequestToOpenAI(modelName string, inputRawJSON []byte, stream
// Temperature
if temp := root.Get("temperature"); temp.Exists() {
out, _ = sjson.Set(out, "temperature", temp.Float())
}
// Top P
if topP := root.Get("top_p"); topP.Exists() {
} else if topP := root.Get("top_p"); topP.Exists() { // Top P
out, _ = sjson.Set(out, "top_p", topP.Float())
}