Merge pull request #3141 from seefs001/fix/claude-thinking-top_p

fix: If top_p is not provided, Claude's logic will set to 1
This commit is contained in:
Calcium-Ion
2026-03-06 12:08:12 +08:00
committed by GitHub

View File

@@ -59,7 +59,6 @@ func ClaudeHelper(c *gin.Context, info *relaycommon.RelayInfo) (newAPIError *typ
Type: "adaptive",
}
request.OutputConfig = json.RawMessage(fmt.Sprintf(`{"effort":"%s"}`, effortLevel))
request.TopP = common.GetPointer[float64](0)
request.Temperature = common.GetPointer[float64](1.0)
info.UpstreamModelName = request.Model
} else if model_setting.GetClaudeSettings().ThinkingAdapterEnabled &&
@@ -77,7 +76,6 @@ func ClaudeHelper(c *gin.Context, info *relaycommon.RelayInfo) (newAPIError *typ
}
// TODO: 临时处理
// https://docs.anthropic.com/en/docs/build-with-claude/extended-thinking#important-considerations-when-using-extended-thinking
request.TopP = common.GetPointer[float64](0)
request.Temperature = common.GetPointer[float64](1.0)
}
if !model_setting.ShouldPreserveThinkingSuffix(info.OriginModelName) {