Files
browser-use/examples/simple.py
2025-08-19 09:58:55 -07:00

30 lines
502 B
Python

import asyncio
import os
import sys
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from dotenv import load_dotenv
load_dotenv()
from browser_use import Agent, ChatOpenAI
async def main():
# Choose your model
llm = ChatOpenAI(model='gpt-4.1-mini')
# Define your task
task = 'Go and find the founders of browser-use'
# Create the agent
agent = Agent(task=task, llm=llm)
# Start
await agent.run(max_steps=2)
if __name__ == '__main__':
asyncio.run(main())