Skip to content

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

Merge branch 'browser-use:main' into main

Federico Villa4e2765b59a33
diff --cc browser_use/agent/service.py
index 083dd2855,d909e7a8c..527dbdbf4
--- a/browser_use/agent/service.py
+++ b/browser_use/agent/service.py
@@@ -189,15 -189,10 +189,15 @@@ class Agent(Generic[Context])
# Model setup
self._set_model_names()
+ logger.info(
+ f"Starting an agent with main_model={self.model_name}, planner_model={self.planner_model_name}, "
+ f"extraction_model={self.settings.page_extraction_llm.model_name if hasattr(self.settings.page_extraction_llm, 'model_name') else None}"
+ )
+
# LLM API connection setup
- llm_api_env_vars = REQUIRED_LLM_API_ENV_VARS[self.llm.__class__.__name__]
- if not check_env_variables(llm_api_env_vars):
+ llm_api_env_vars = REQUIRED_LLM_API_ENV_VARS.get(self.llm.__class__.__name__, [])
+ if llm_api_env_vars and not check_env_variables(llm_api_env_vars):
logger.error(f'Environment variables not set for {self.llm.__class__.__name__}')
raise ValueError('Environment variables not set')