From c459878152b81ddff963f8a33ae756bf86f9922e Mon Sep 17 00:00:00 2001 From: multipleof4 Date: Fri, 24 Jul 2026 16:17:19 -0700 Subject: [PATCH] Feat: Handle none effort across providers Co-authored-by: gemini-3.6-flash --- providers.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/providers.js b/providers.js index ab1c59c..2d1cfaf 100644 --- a/providers.js +++ b/providers.js @@ -179,7 +179,9 @@ export async function streamClaude({ apiKey, body, signal, onDelta, isRunning }) if (Number.isFinite(+body.top_p)) payload.top_p = +body.top_p const effort = body.reasoning?.effort - if (effort && effort !== 'default') { + if (effort === 'none') { + payload.thinking = { type: 'disabled' } + } else if (effort && effort !== 'default') { payload.thinking = { type: 'adaptive' } payload.output_config = { effort } } @@ -222,9 +224,11 @@ export async function streamGoogle({ apiKey, body, signal, onDelta, isRunning }) }).reduce((acc, [k, v]) => (Number.isFinite(+v) && +v >= 0 ? { ...acc, [k]: +v } : acc), {}) if (body.reasoning) { + const effort = body.reasoning.effort + const thinkingLevel = effort === 'none' ? 'minimal' : (effort && effort !== 'default' ? effort : undefined) generationConfig.thinkingConfig = { includeThoughts: body.reasoning.exclude !== true, - ...(body.reasoning.effort && body.reasoning.effort !== 'default' && { thinkingLevel: body.reasoning.effort }), + ...(thinkingLevel && { thinkingLevel }), } } if (body.response_format?.type?.startsWith('json')) {