From 330e4d9ab5559ca2bf7ade3a3d73b0fe30616c19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Magnus=20M=C3=BCller?= <67061560+MagMueller@users.noreply.github.com> Date: Sun, 20 Jul 2025 23:54:03 +0200 Subject: [PATCH] Simple example --- examples/simple.py | 26 ++++---------------------- 1 file changed, 4 insertions(+), 22 deletions(-) diff --git a/examples/simple.py b/examples/simple.py index 3204f280e..f9bfe8132 100644 --- a/examples/simple.py +++ b/examples/simple.py @@ -10,39 +10,21 @@ from dotenv import load_dotenv load_dotenv() -try: - from lmnr import Instruments, Laminar - - Laminar.initialize(project_api_key=os.getenv('LMNR_PROJECT_API_KEY'), disabled_instruments={Instruments.BROWSER_USE}) -except Exception: - print('Error initializing Laminar') - pass from browser_use import Agent # Initialize the model llm = ChatOpenAI( - model='o4-mini', - temperature=0.2, + model='gpt-4.1-mini', ) -# Optimized task with more specific instructions -task = """ -Navigate to the Qatar Airways homepage and search for flights from Doha to Paris departing in the upcoming week; then list the available fare classes and prices. -Only use https://www.qatarairways.com/ to achieve the task. Don't go to any other site. The task is achievable with just navigation from this site.""" -task = ' call done directly and repeat the word "New" 100 times' -# Performance optimizations -agent = Agent( - task=task, - llm=llm, -) +task = 'Find the founders of browser-use' +agent = Agent(task=task, llm=llm) async def main(): - history = await agent.run(max_steps=10) - # token usage - print(history.usage) + await agent.run() if __name__ == '__main__':