Files
browser-use/examples/simple.py
2025-03-26 00:49:16 -07:00

31 lines
522 B
Python

import os
import sys
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
import asyncio
from dotenv import load_dotenv
from langchain_openai import ChatOpenAI
from browser_use import Agent
load_dotenv()
# Initialize the model
llm = ChatOpenAI(
model='gpt-4o',
temperature=0.0,
)
task = 'Find the founders of browser-use and draft them a short personalized message'
agent = Agent(task=task, llm=llm)
async def main():
await agent.run()
if __name__ == '__main__':
asyncio.run(main())