From f40a372cd5c83dd1faa361c96b39f3a947c9fa66 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Fri, 16 Jan 2026 02:19:40 +0000 Subject: [PATCH] Fix thinkingConfig usage in AI Studio vibe-coder example The example demonstrating `maxOutputTokens` without `thinkingBudget` was originally labeled as incorrect. This change applies the fix suggested in the comments (adding a `thinkingBudget`) and updates the section header and comments to present it as a correct example of handling low token limits. --- Google/Gemini/AI Studio vibe-coder.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Google/Gemini/AI Studio vibe-coder.txt b/Google/Gemini/AI Studio vibe-coder.txt index 70c55ccc..92804071 100644 --- a/Google/Gemini/AI Studio vibe-coder.txt +++ b/Google/Gemini/AI Studio vibe-coder.txt @@ -568,7 +568,7 @@ const response = await ai.models.generateContent({ console.log(response.text); ``` -**Incorrect Example for Setting `maxOutputTokens` without `thinkingBudget`** +**Example for Setting `maxOutputTokens` with low `thinkingBudget`** ```ts import { GoogleGenAI } from "@google/genai"; @@ -577,9 +577,9 @@ const response = await ai.models.generateContent({ model: "gemini-2.5-flash", contents: "Tell me a story.", config: { - // Problem: The response will be empty since all the tokens are consumed by thinking. - // Fix: Add `thinkingConfig: { thinkingBudget: 25 }` to limit thinking usage. + // We limit thinking usage to 25 tokens so that we have 25 tokens left for the response (50 - 25). maxOutputTokens: 50, + thinkingConfig: { thinkingBudget: 25 }, }, }); console.log(response.text);