From 3378815f8cd95bb850254eab22505f8adec18b62 Mon Sep 17 00:00:00 2001 From: multipleof4 Date: Fri, 12 Sep 2025 22:24:02 -0700 Subject: [PATCH] Fix: Explicitly set includeThoughts for Google provider --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 0f178c0..50c48be 100644 --- a/index.js +++ b/index.js @@ -265,7 +265,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?.exclude !== true) generationConfig.thinkingConfig = { includeThoughts: true }; + if (body.reasoning) generationConfig.thinkingConfig = { includeThoughts: body.reasoning.exclude !== true }; if (body.response_format?.type?.startsWith('json')) { generationConfig.responseMimeType = 'application/json'; if (body.response_format.json_schema) {