mirror of
https://github.com/browser-use/browser-use.git
synced 2026-09-14 19:59:47 +08:00
chore(llm): recommend gemini-3-flash-preview in examples and tests
- add gemini-3-flash-preview-lite to VerifiedGeminiModels and token mappings - list both gemini-3-flash-preview[-lite] alongside existing -latest aliases in CLOUD.md and api-v2.md SupportedLLMs - swap example code and recommendations (examples/, AGENTS.md, quickstart.md, bug report placeholder) to gemini-3-flash-preview / -lite - update Google CI test + evaluate_tasks judge LLM to gemini-3-flash-preview / -lite
This commit is contained in:
@@ -57,7 +57,7 @@ body:
|
||||
attributes:
|
||||
label: LLM Model
|
||||
description: Which LLM model are you using? (Optional)
|
||||
placeholder: "e.g. ChatBrowserUse, gpt-4.1-mini, gemini-flash-latest, etc."
|
||||
placeholder: "e.g. ChatBrowserUse, gpt-4.1-mini, gemini-3-flash-preview, etc."
|
||||
|
||||
- type: input
|
||||
id: os
|
||||
|
||||
@@ -126,7 +126,7 @@ See [Supported Models](https://docs.browser-use.com/supported-models#supported-m
|
||||
load_dotenv()
|
||||
|
||||
async def main():
|
||||
llm = ChatGoogle(model="gemini-flash-latest")
|
||||
llm = ChatGoogle(model="gemini-3-flash-preview")
|
||||
task = "Find the number 1 post on Show HN"
|
||||
agent = Agent(task=task, llm=llm)
|
||||
await agent.run()
|
||||
|
||||
@@ -383,6 +383,8 @@ components:
|
||||
- value: gemini-2.5-pro
|
||||
- value: gemini-flash-latest
|
||||
- value: gemini-flash-lite-latest
|
||||
- value: gemini-3-flash-preview
|
||||
- value: gemini-3-flash-preview-lite
|
||||
- value: claude-sonnet-4-20250514
|
||||
- value: gpt-4o
|
||||
- value: gpt-4o-mini
|
||||
|
||||
@@ -35,6 +35,7 @@ VerifiedGeminiModels = Literal[
|
||||
'gemini-2.5-pro',
|
||||
'gemini-3-pro-preview',
|
||||
'gemini-3-flash-preview',
|
||||
'gemini-3-flash-preview-lite',
|
||||
'gemma-3-27b-it',
|
||||
'gemma-3-4b',
|
||||
'gemma-3-12b',
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
# Mapping from model_name to LiteLLM model name
|
||||
MODEL_TO_LITELLM: dict[str, str] = {
|
||||
'gemini-flash-latest': 'gemini/gemini-flash-latest',
|
||||
'gemini-3-flash-preview': 'gemini/gemini-3-flash-preview',
|
||||
'gemini-3-flash-preview-lite': 'gemini/gemini-3-flash-preview-lite',
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ async def main():
|
||||
browser = Browser.from_system_chrome(profile_directory=profile)
|
||||
|
||||
agent = Agent(
|
||||
llm=ChatGoogle(model='gemini-flash-latest'),
|
||||
llm=ChatGoogle(model='gemini-3-flash-preview'),
|
||||
task='go to amazon.com and search for pens to draw on whiteboards',
|
||||
browser=browser,
|
||||
)
|
||||
|
||||
@@ -13,7 +13,7 @@ load_dotenv()
|
||||
|
||||
from browser_use import Agent
|
||||
|
||||
llm = ChatGoogle(model='gemini-flash-latest', temperature=1.0)
|
||||
llm = ChatGoogle(model='gemini-3-flash-preview', temperature=1.0)
|
||||
|
||||
|
||||
def check_is_task_stopped():
|
||||
|
||||
@@ -31,7 +31,7 @@ async def main():
|
||||
)
|
||||
# from browser_use import ChatGoogle
|
||||
|
||||
# llm = ChatGoogle(model='gemini-flash-lite-latest')
|
||||
# llm = ChatGoogle(model='gemini-3-flash-preview-lite')
|
||||
|
||||
# 2. Create speed-optimized browser profile
|
||||
browser_profile = BrowserProfile(
|
||||
|
||||
@@ -16,7 +16,7 @@ if not api_key:
|
||||
|
||||
|
||||
async def run_search():
|
||||
llm = ChatGoogle(model='gemini-flash-latest', api_key=api_key)
|
||||
llm = ChatGoogle(model='gemini-3-flash-preview', api_key=api_key)
|
||||
agent = Agent(
|
||||
llm=llm,
|
||||
task='How many stars does the browser-use repo have?',
|
||||
|
||||
@@ -302,7 +302,7 @@ Response includes: `{ items: [...], totalItems, pageNumber, pageSize }`
|
||||
| SessionStatus | `active`, `stopped` |
|
||||
| BrowserSessionStatus | `active`, `stopped` |
|
||||
| ProxyCountryCode | `us`, `uk`, `fr`, `it`, `jp`, `au`, `de`, `fi`, `ca`, `in` (+185 more) |
|
||||
| SupportedLLMs | `browser-use-llm`, `gpt-4.1`, `gpt-4.1-mini`, `o4-mini`, `o3`, `gemini-2.5-flash`, `gemini-2.5-pro`, `gemini-flash-latest`, `gemini-flash-lite-latest`, `claude-sonnet-4-20250514`, `gpt-4o`, `gpt-4o-mini`, `llama-4-maverick-17b-128e-instruct`, `claude-3-7-sonnet-20250219` |
|
||||
| SupportedLLMs | `browser-use-llm`, `gpt-4.1`, `gpt-4.1-mini`, `o4-mini`, `o3`, `gemini-2.5-flash`, `gemini-2.5-pro`, `gemini-flash-latest`, `gemini-flash-lite-latest`, `gemini-3-flash-preview`, `gemini-3-flash-preview-lite`, `claude-sonnet-4-20250514`, `gpt-4o`, `gpt-4o-mini`, `llama-4-maverick-17b-128e-instruct`, `claude-3-7-sonnet-20250219` |
|
||||
| UploadContentType | `image/jpg`, `image/jpeg`, `image/png`, `image/gif`, `image/webp`, `image/svg+xml`, `application/pdf`, `application/msword`, `application/vnd.openxmlformats-officedocument.wordprocessingml.document`, `application/vnd.ms-excel`, `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`, `text/plain`, `text/csv`, `text/markdown` |
|
||||
|
||||
## Response Schemas
|
||||
|
||||
@@ -64,7 +64,7 @@ import asyncio
|
||||
load_dotenv()
|
||||
|
||||
async def main():
|
||||
llm = ChatGoogle(model="gemini-flash-latest")
|
||||
llm = ChatGoogle(model="gemini-3-flash-preview")
|
||||
agent = Agent(task="Find the number 1 post on Show HN", llm=llm)
|
||||
await agent.run()
|
||||
|
||||
|
||||
@@ -79,7 +79,7 @@ async def run_single_task(task_file):
|
||||
'explanation': 'Skipped - Google API key not available (fork PR or missing secret)',
|
||||
}
|
||||
|
||||
judge_llm = ChatGoogle(model='gemini-flash-lite-latest')
|
||||
judge_llm = ChatGoogle(model='gemini-3-flash-preview-lite')
|
||||
print('[DEBUG] LLMs initialized', file=sys.stderr)
|
||||
|
||||
# Each subprocess gets its own profile and session
|
||||
|
||||
@@ -4,11 +4,11 @@ from browser_use.llm.google.chat import ChatGoogle
|
||||
from tests.ci.models.model_test_helper import run_model_button_click_test
|
||||
|
||||
|
||||
async def test_google_gemini_flash_latest(httpserver):
|
||||
"""Test Google gemini-flash-latest can click a button."""
|
||||
async def test_google_gemini_3_flash_preview(httpserver):
|
||||
"""Test Google gemini-3-flash-preview can click a button."""
|
||||
await run_model_button_click_test(
|
||||
model_class=ChatGoogle,
|
||||
model_name='gemini-flash-latest',
|
||||
model_name='gemini-3-flash-preview',
|
||||
api_key_env='GOOGLE_API_KEY',
|
||||
extra_kwargs={},
|
||||
httpserver=httpserver,
|
||||
|
||||
Reference in New Issue
Block a user