mirror of
https://github.com/browser-use/browser-use
synced 2026-05-06 17:52:15 +02:00
26 lines
404 B
Python
26 lines
404 B
Python
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,
|
|
)
|
|
|
|
# Create agent with the model
|
|
agent = Agent(task='Go to amazon.com and search for "laptop"', llm=llm)
|
|
|
|
|
|
async def main():
|
|
await agent.run()
|
|
|
|
|
|
if __name__ == '__main__':
|
|
asyncio.run(main())
|