import os, asyncio from langchainopenai import AzureChatOpenAI from browseruse import…
- User
import os, asyncio from langchain_openai import AzureChatOpenAI from browser_use import Agent, Browser, BrowserConfig from browser_use.browser.context import BrowserContextConfig from dotenv import load_dotenv
Load environment variables from the .env file
load_dotenv(r"C:\Users\YINL\OneDrive - Bird & Bird LLP\Desktop\jupyter notebooks.env")
llm = AzureChatOpenAI( azure_endpoint=os.environ["AZURE_OPENAI_ENDPOINT"], azure_deployment=os.environ["AZURE_OPENAI_DEPLOYMENT_ID"], openai_api_version=os.environ["OPENAI_API_VERSION"], )
Define the context configuration
context_config = BrowserContextConfig( browser_window_size={"width": 1280, "height": 720}, disable_security=True, )
Configure and initialize the browser
browser = Browser( config=BrowserConfig( headless=False, disable_security=True, chrome_instance_path=r"C:\Program Files\Google\Chrome\Application\chrome.exe", extra_chromium_args=[ r"--user-data-dir=C:\Users\YINL\AppData\Local\Google\Chrome\User Data" ], new_context_config=context_config, ) )
async def main(): agent = Agent( task="search 'openai' on google.com and describe the result page.", llm=llm, use_vision=True, browser=browser, save_conversation_path="logs/conversation.json", ) result = await agent.run() print(result)
asyncio.run(main())
Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.