From f101fbf2e43eec89a0b913a1f2c9b23b0276e3b8 Mon Sep 17 00:00:00 2001 From: Rodrigo Lazo Paz Date: Mon, 12 Jan 2026 17:35:07 -0500 Subject: [PATCH 1/2] [AI] Documentation improvements to ThinkingConfig Add more detailed description of the difference between `setThinkingBudget` and `setThinkingLevel`. --- .../google/firebase/ai/type/ThinkingConfig.kt | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/firebase-ai/src/main/kotlin/com/google/firebase/ai/type/ThinkingConfig.kt b/firebase-ai/src/main/kotlin/com/google/firebase/ai/type/ThinkingConfig.kt index 0355ec80952..b8866a9be3f 100644 --- a/firebase-ai/src/main/kotlin/com/google/firebase/ai/type/ThinkingConfig.kt +++ b/firebase-ai/src/main/kotlin/com/google/firebase/ai/type/ThinkingConfig.kt @@ -48,15 +48,30 @@ private constructor( /** * Indicates the thinking budget in tokens. * - * Use `0` for disabled, and `-1` for dynamic. The range of + * The range of * [supported thinking budget values](https://firebase.google.com/docs/ai-logic/thinking#supported-thinking-budget-values) * depends on the model. + * - To disable thinking, when supported by the model, set this value to `0`. + * - To use dynamic thinking, allowing the model to decide on the thinking budget based on + * the task, set this value to `-1`. */ public fun setThinkingBudget(thinkingBudget: Int): Builder = apply { this.thinkingBudget = thinkingBudget } - /** Indicates the thinking budget based in Levels. */ + /** + * Indicates the thinking budget in [ThinkingLevel]s. + * + * If you don't specify a thinking level, Gemini will use the model's default dynamic thinking + * level. + * + * > Important: Gemini 2.5 series models do not support thinking levels; use + * > [setThinkingBudget] to set a thinking budget instead. + * + * @param thinkingLevel A preset that controls the model's "thinking" process. Use + * [ThinkingLevel.LOW] for faster responses on less complex tasks, and [ThinkingLevel.HIGH] + * for better reasoning on more complex tasks. + */ public fun setThinkingLevel(thinkingLevel: ThinkingLevel): Builder = apply { this.thinkingLevel = thinkingLevel } From ef821080c0173d9e75dbe8a28e4dfe8f4c741ef2 Mon Sep 17 00:00:00 2001 From: Rodrigo Lazo Paz Date: Tue, 13 Jan 2026 15:17:02 -0500 Subject: [PATCH 2/2] Format fix --- .../com/google/firebase/ai/type/ThinkingConfig.kt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/firebase-ai/src/main/kotlin/com/google/firebase/ai/type/ThinkingConfig.kt b/firebase-ai/src/main/kotlin/com/google/firebase/ai/type/ThinkingConfig.kt index b8866a9be3f..aaf33f1bcd1 100644 --- a/firebase-ai/src/main/kotlin/com/google/firebase/ai/type/ThinkingConfig.kt +++ b/firebase-ai/src/main/kotlin/com/google/firebase/ai/type/ThinkingConfig.kt @@ -52,8 +52,8 @@ private constructor( * [supported thinking budget values](https://firebase.google.com/docs/ai-logic/thinking#supported-thinking-budget-values) * depends on the model. * - To disable thinking, when supported by the model, set this value to `0`. - * - To use dynamic thinking, allowing the model to decide on the thinking budget based on - * the task, set this value to `-1`. + * - To use dynamic thinking, allowing the model to decide on the thinking budget based on the + * task, set this value to `-1`. */ public fun setThinkingBudget(thinkingBudget: Int): Builder = apply { this.thinkingBudget = thinkingBudget @@ -65,12 +65,12 @@ private constructor( * If you don't specify a thinking level, Gemini will use the model's default dynamic thinking * level. * - * > Important: Gemini 2.5 series models do not support thinking levels; use - * > [setThinkingBudget] to set a thinking budget instead. + * > Important: Gemini 2.5 series models do not support thinking levels; use [setThinkingBudget] + * to set a thinking budget instead. * * @param thinkingLevel A preset that controls the model's "thinking" process. Use - * [ThinkingLevel.LOW] for faster responses on less complex tasks, and [ThinkingLevel.HIGH] - * for better reasoning on more complex tasks. + * [ThinkingLevel.LOW] for faster responses on less complex tasks, and [ThinkingLevel.HIGH] for + * better reasoning on more complex tasks. */ public fun setThinkingLevel(thinkingLevel: ThinkingLevel): Builder = apply { this.thinkingLevel = thinkingLevel