mirror of
https://github.com/browser-use/browser-use
synced 2026-05-06 17:52:15 +02:00
* Add captcha demo gif * Captcha demo * Host gif at imgur * Try to include from other repo * Hugging face example * Try to display mp4 * Include mp4 with raw link * Try with git user content .com * More methods * Update README.md * Add custom function * Try with only the link * Readme update * Display video * Flight search example * Update README.md * Update prompts * Prompts above videos * Space between div and video * Font size
30 lines
497 B
Python
30 lines
497 B
Python
"""
|
|
Simple try of the agent.
|
|
|
|
@dev You need to add OPENAI_API_KEY to your environment variables.
|
|
"""
|
|
|
|
import os
|
|
import sys
|
|
|
|
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
|
|
|
import asyncio
|
|
|
|
from langchain_openai import ChatOpenAI
|
|
|
|
from browser_use import Agent
|
|
|
|
llm = ChatOpenAI(model='gpt-4o')
|
|
agent = Agent(
|
|
task='Find flights on kayak.com from Zurich to Beijing on 25.12.2024 to 02.02.2025',
|
|
llm=llm,
|
|
)
|
|
|
|
|
|
async def main():
|
|
await agent.run()
|
|
|
|
|
|
asyncio.run(main())
|