Skip to content

Open-source Python library for AI browser agents, plus Browser Use Cloud: stealth browsers and a hosted agent API.

Update thinking_budget default value to 0 for flash and flash-lite models

Magnus Müllerd5ba9008b7c1
diff --git a/browser_use/llm/google/chat.py b/browser_use/llm/google/chat.py
index b00bb4d5c..24f823354 100644
--- a/browser_use/llm/google/chat.py
+++ b/browser_use/llm/google/chat.py
@@ -75,7 +75,7 @@ class ChatGoogle(BaseChatModel):
temperature: float | None = 0.2
top_p: float | None = None
seed: int | None = None
- thinking_budget: int | None = None
+ thinking_budget: int | None = None # for flash and flash-lite models, default will be set to 0
max_output_tokens: int | None = 4096
config: types.GenerateContentConfigDict | None = None
include_system_in_user: bool = False
@@ -198,8 +198,9 @@ class ChatGoogle(BaseChatModel):
if self.seed is not None:
config['seed'] = self.seed
+ # set default for flash and falsh-lite
if self.thinking_budget is None and 'gemini-2.5-flash' in self.model:
- self.thinking_budget = -1
+ self.thinking_budget = 0
if self.thinking_budget is not None:
thinking_config_dict: types.ThinkingConfigDict = {'thinking_budget': self.thinking_budget}