Skip to content

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

Add api key

Magnus Müller6cf5c540750c
diff --git a/tests/ci/evaluate_tasks.py b/tests/ci/evaluate_tasks.py
index 6e7da5c85..cc79a7a08 100644
--- a/tests/ci/evaluate_tasks.py
+++ b/tests/ci/evaluate_tasks.py
@@ -16,10 +16,12 @@ import warnings
import anyio
import yaml
from pydantic import BaseModel
-
+from dotenv import load_dotenv
+load_dotenv()
from browser_use import Agent, AgentHistoryList, BrowserProfile, BrowserSession, ChatBrowserUse
from browser_use.llm.messages import UserMessage
+
# --- CONFIG ---
MAX_PARALLEL = 10
TASK_DIR = (
@@ -55,9 +57,12 @@ async def run_single_task(task_file):
print(f'[DEBUG] Task: {task[:100]}...', file=sys.stderr)
print(f'[DEBUG] Max steps: {max_steps}', file=sys.stderr)
+ api_key = os.getenv('BROWSER_USE_API_KEY')
+ if not api_key:
+ raise ValueError('BROWSER_USE_API_KEY is not set')
- agent_llm = ChatBrowserUse()
- judge_llm = ChatBrowserUse()
+ agent_llm = ChatBrowserUse(api_key=api_key)
+ judge_llm = ChatBrowserUse(api_key=api_key)
print('[DEBUG] LLMs initialized', file=sys.stderr)
# Each subprocess gets its own profile and session