Skip to content

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

change parameter chat google

Magnus Müllerf3bab2d78194
diff --git a/browser_use/llm/google/chat.py b/browser_use/llm/google/chat.py
index 66ba74b90..52cf62b20 100644
--- a/browser_use/llm/google/chat.py
+++ b/browser_use/llm/google/chat.py
@@ -73,10 +73,11 @@ class ChatGoogle(BaseChatModel):
# Model configuration
model: VerifiedGeminiModels | str
- temperature: float | None = None
+ temperature: float | None = 0.2 # Match OpenAI default
top_p: float | None = None
seed: int | None = None
thinking_budget: int | None = None
+ max_output_tokens: int | None = 4096 # Match OpenAI default
config: types.GenerateContentConfigDict | None = None
# Client initialization parameters
@@ -193,6 +194,9 @@ class ChatGoogle(BaseChatModel):
thinking_config_dict: types.ThinkingConfigDict = {'thinking_budget': self.thinking_budget}
config['thinking_config'] = thinking_config_dict
+ if self.max_output_tokens is not None:
+ config['max_output_tokens'] = self.max_output_tokens
+
async def _make_api_call():
if output_format is None:
# Return string response
diff --git a/pyproject.toml b/pyproject.toml
index 80d820a4e..7a8db62fb 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -199,4 +199,5 @@ dev-dependencies = [
"lmnr[all]==0.7.6",
# "pytest-playwright-asyncio>=0.7.0", # not actually needed I think
"pytest-timeout>=2.4.0",
+ "pydantic_settings>=2.10.1"
]