fix: do not enable OpenRouter reasoning by default

This commit is contained in:
Simon
2026-07-03 20:30:57 +08:00
parent 10276c6e67
commit 9a75ead6ad
+8 -8
View File
@@ -160,15 +160,15 @@ export function modelPatch(body: Record<string, any>, baseURL?: string) {
// openrouter use reasoning object instead of reasoning_effort // openrouter use reasoning object instead of reasoning_effort
const reasoningEffort = body.reasoning_effort const reasoningEffort = body.reasoning_effort
let reasoningEnabled = true const reasoningDisabled =
if (body.thinking?.type === 'disabled') reasoningEnabled = false body.thinking?.type === 'disabled' ||
if (body.enable_thinking === false) reasoningEnabled = false body.enable_thinking === false ||
if (reasoningEffort === 'none') reasoningEnabled = false reasoningEffort === 'none'
body.reasoning = { enabled: reasoningEnabled } if (reasoningDisabled) {
body.reasoning = { enabled: false }
if (reasoningEnabled && reasoningEffort) { } else if (reasoningEffort) {
body.reasoning.effort = reasoningEffort body.reasoning = { enabled: true, effort: reasoningEffort }
} }
} }