Unified · Split
| @@ -98,9 +98,8 @@ func ConvertGeminiRequestToClaude(modelName string, inputRawJSON []byte, stream · 97 unmodified lines | ||
| 98 | 98 | // Temperature setting for controlling response randomness |
| 99 | 99 | if temp := genConfig.Get("temperature"); temp.Exists() { |
| 100 | 100 | out, _ = sjson.Set(out, "temperature", temp.Float()) |
| 101 | − } | |
| 102 | − // Top P setting for nucleus sampling (filtered out if temperature is set) | |
| 103 | − if topP := genConfig.Get("topP"); topP.Exists() && !genConfig.Get("temperature").Exists() { | |
| 101 | + } else if topP := genConfig.Get("topP"); topP.Exists() { | |
| 102 | + // Top P setting for nucleus sampling (filtered out if temperature is set) | |
| 104 | 103 | out, _ = sjson.Set(out, "top_p", topP.Float()) |
| 105 | 104 | } |
| 106 | 105 | // Stop sequences configuration for custom termination conditions |
| @@ -110,10 +110,8 @@ func ConvertOpenAIRequestToClaude(modelName string, inputRawJSON []byte, stream · 109 unmodified lines | ||
| 110 | 110 | // Temperature setting for controlling response randomness |
| 111 | 111 | if temp := root.Get("temperature"); temp.Exists() { |
| 112 | 112 | out, _ = sjson.Set(out, "temperature", temp.Float()) |
| 113 | − } | |
| 114 | − | |
| 115 | − // Top P setting for nucleus sampling (filtered out if temperature is set) | |
| 116 | − if topP := root.Get("top_p"); topP.Exists() && !root.Get("temperature").Exists() { | |
| 113 | + } else if topP := root.Get("top_p"); topP.Exists() { | |
| 114 | + // Top P setting for nucleus sampling (filtered out if temperature is set) | |
| 117 | 115 | out, _ = sjson.Set(out, "top_p", topP.Float()) |
| 118 | 116 | } |
| 119 | 117 | |