From 230e9e2b8b3c2e570c57188dacdbfc91e4b993f7 Mon Sep 17 00:00:00 2001 From: multipleof4 Date: Tue, 25 Nov 2025 13:38:41 -0800 Subject: [PATCH] Fix: Map all reasoning efforts to Google thinkingLevel --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 0d58542..5700164 100644 --- a/index.js +++ b/index.js @@ -283,7 +283,7 @@ export class MyDurableObject { async streamGoogle({ apiKey, body }) { const generationConfig = Object.entries({ temperature: body.temperature, topP: body.top_p, maxOutputTokens: body.max_tokens }).reduce((acc, [k, v]) => (Number.isFinite(+v) && +v >= 0 ? { ...acc, [k]: +v } : acc), {}); - if (body.reasoning) generationConfig.thinkingConfig = { includeThoughts: body.reasoning.exclude !== true, ...(body.reasoning.effort && body.reasoning.effort !== 'default' && { thinkingLevel: body.reasoning.effort === 'low' ? 'low' : 'high' }) }; + if (body.reasoning) generationConfig.thinkingConfig = { includeThoughts: body.reasoning.exclude !== true, ...(body.reasoning.effort && body.reasoning.effort !== 'default' && { thinkingLevel: body.reasoning.effort }) }; if (body.response_format?.type?.startsWith('json')) { generationConfig.responseMimeType = 'application/json'; if (body.response_format.json_schema) {