mirror of
https://github.com/router-for-me/CLIProxyAPI.git
synced 2026-02-03 04:50:52 +08:00
Accept Geminis Review Suggestion
This commit is contained in:
@@ -98,9 +98,8 @@ func ConvertGeminiRequestToClaude(modelName string, inputRawJSON []byte, stream
|
|||||||
// Temperature setting for controlling response randomness
|
// Temperature setting for controlling response randomness
|
||||||
if temp := genConfig.Get("temperature"); temp.Exists() {
|
if temp := genConfig.Get("temperature"); temp.Exists() {
|
||||||
out, _ = sjson.Set(out, "temperature", temp.Float())
|
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)
|
// 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())
|
out, _ = sjson.Set(out, "top_p", topP.Float())
|
||||||
}
|
}
|
||||||
// Stop sequences configuration for custom termination conditions
|
// Stop sequences configuration for custom termination conditions
|
||||||
|
|||||||
@@ -110,10 +110,8 @@ func ConvertOpenAIRequestToClaude(modelName string, inputRawJSON []byte, stream
|
|||||||
// Temperature setting for controlling response randomness
|
// Temperature setting for controlling response randomness
|
||||||
if temp := root.Get("temperature"); temp.Exists() {
|
if temp := root.Get("temperature"); temp.Exists() {
|
||||||
out, _ = sjson.Set(out, "temperature", temp.Float())
|
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)
|
||||||
// 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())
|
out, _ = sjson.Set(out, "top_p", topP.Float())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user