Skip to content

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

better error handling and lmnr inclusion

Magnus Müllerb1a0decb62ed
diff --git a/examples/simple.py b/examples/simple.py
index 05e92b6ef..910fa596a 100644
--- a/examples/simple.py
+++ b/examples/simple.py
@@ -2,6 +2,8 @@ import asyncio
import os
import sys
+from lmnr import Instruments
+
from browser_use.llm.openai.chat import ChatOpenAI
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
@@ -13,7 +15,9 @@ load_dotenv()
try:
from lmnr import Laminar
- Laminar.initialize(project_api_key=os.getenv('LMNR_PROJECT_API_KEY'))
+ Laminar.initialize(
+ project_api_key=os.getenv('LMNR_PROJECT_API_KEY'), disable_batch=True, disabled_instruments={Instruments.BROWSER_USE}
+ )
except Exception:
print('Error initializing Laminar')
pass
@@ -26,7 +30,8 @@ llm = ChatOpenAI(
)
-task = 'Find the founders of browser-use'
+task = """Search for the translation of the word "love" from English to Spanish and list at least three contextual example sentences provided on Glosbe.
+Only use https://glosbe.com/ to achieve the task. Don't go to any other site. The task is achievable with just navigation from this site."""
agent = Agent(task=task, llm=llm)