Returned the Code Comment I trashed

This commit is contained in:
N1GHT
2026-01-20 17:36:27 +01:00
parent a6cba25bc1
commit d81abd401c
2 changed files with 7 additions and 2 deletions

View File

@@ -98,7 +98,9 @@ func ConvertGeminiRequestToClaude(modelName string, inputRawJSON []byte, stream
// Temperature setting for controlling response randomness
if temp := genConfig.Get("temperature"); temp.Exists() {
out, _ = sjson.Set(out, "temperature", temp.Float())
} else if topP := genConfig.Get("topP"); topP.Exists() {
}
// Top P setting for nucleus sampling (filtered out if temperature is set)
if topP := genConfig.Get("topP"); topP.Exists() && !genConfig.Get("temperature").Exists() {
out, _ = sjson.Set(out, "top_p", topP.Float())
}
// Stop sequences configuration for custom termination conditions

View File

@@ -110,7 +110,10 @@ func ConvertOpenAIRequestToClaude(modelName string, inputRawJSON []byte, stream
// Temperature setting for controlling response randomness
if temp := root.Get("temperature"); temp.Exists() {
out, _ = sjson.Set(out, "temperature", temp.Float())
} else if topP := root.Get("top_p"); topP.Exists() {
}
// Top P setting for nucleus sampling (filtered out if temperature is set)
if topP := root.Get("top_p"); topP.Exists() && !root.Get("temperature").Exists() {
out, _ = sjson.Set(out, "top_p", topP.Float())
}