History

Accept Geminis Review Suggestion

N1GHT committed 9 months ago

Commit 09970dc1 parent d81abd42 files · +4 −7Browse files

Unified · Split

2 files
  1. internal/translator/claude/gemini/claude_gemini_request.go +2 −3
  2. internal/translator/claude/openai/chat-completions/claude_openai_request.go +2 −4
internal/translator/claude/gemini/claude_gemini_request.go+2−3
@@ -98,9 +98,8 @@ func ConvertGeminiRequestToClaude(modelName string, inputRawJSON []byte, stream · 97 unmodified lines
98 // Temperature setting for controlling response randomness98 // Temperature setting for controlling response randomness
99 if temp := genConfig.Get("temperature"); temp.Exists() {99 if temp := genConfig.Get("temperature"); temp.Exists() {
100 out, _ = sjson.Set(out, "temperature", temp.Float())100 out, _ = sjson.Set(out, "temperature", temp.Float())
101 }101 } else if topP := genConfig.Get("topP"); topP.Exists() {
102 // Top P setting for nucleus sampling (filtered out if temperature is set)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() {
104 out, _ = sjson.Set(out, "top_p", topP.Float())103 out, _ = sjson.Set(out, "top_p", topP.Float())
105 }104 }
106 // Stop sequences configuration for custom termination conditions105 // Stop sequences configuration for custom termination conditions
internal/translator/claude/openai/chat-completions/claude_openai_request.go+2−4
@@ -110,10 +110,8 @@ func ConvertOpenAIRequestToClaude(modelName string, inputRawJSON []byte, stream · 109 unmodified lines
110 // Temperature setting for controlling response randomness110 // Temperature setting for controlling response randomness
111 if temp := root.Get("temperature"); temp.Exists() {111 if temp := root.Get("temperature"); temp.Exists() {
112 out, _ = sjson.Set(out, "temperature", temp.Float())112 out, _ = sjson.Set(out, "temperature", temp.Float())
113 }113 } else if topP := root.Get("top_p"); topP.Exists() {
114 114 // Top P setting for nucleus sampling (filtered out if temperature is set)
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() {
117 out, _ = sjson.Set(out, "top_p", topP.Float())115 out, _ = sjson.Set(out, "top_p", topP.Float())
118 }116 }
119 117