mirror of
https://github.com/browser-use/browser-use
synced 2026-05-06 17:52:15 +02:00
27 lines
622 B
Python
27 lines
622 B
Python
import asyncio
|
|
import os
|
|
import sys
|
|
|
|
sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
|
|
|
|
from dotenv import load_dotenv
|
|
|
|
load_dotenv()
|
|
|
|
from langchain_openai import ChatOpenAI
|
|
|
|
from browser_use import Agent
|
|
|
|
llm = ChatOpenAI(model='gpt-4o', temperature=0.0)
|
|
small_llm = ChatOpenAI(model='gpt-4o-mini', temperature=0.0)
|
|
task = 'Find the founders of browser-use in ycombinator, extract all links and open the links one by one'
|
|
agent = Agent(task=task, llm=llm, page_extraction_llm=small_llm)
|
|
|
|
|
|
async def main():
|
|
await agent.run()
|
|
|
|
|
|
if __name__ == '__main__':
|
|
asyncio.run(main())
|