Skip to content

Open-source Python library for AI browser agents, plus Browser Use Cloud: stealth browsers and a hosted agent API.

Change llm

Magnus Müller8e29922da56b
diff --git a/examples/integrations/agentmail/2fa.py b/examples/integrations/agentmail/2fa.py
index dc3b1cdbf..aa65df025 100644
--- a/examples/integrations/agentmail/2fa.py
+++ b/examples/integrations/agentmail/2fa.py
@@ -1,31 +1,17 @@
import asyncio
-import os
-from browser_use import Agent
+from browser_use import Agent, ChatOpenAI
from examples.integrations.agentmail.email_tools import EmailController
TASK = """
Go to reddit.com, create a new account (use the get_email_address), make up password and all other information, confirm the 2fa, and like latest post on r/elon subreddit.
"""
-from browser_use.llm import ChatAzureOpenAI
-
-api_key = os.getenv('AZURE_OPENAI_KEY')
-azure_endpoint = os.getenv('AZURE_OPENAI_ENDPOINT')
-llm = ChatAzureOpenAI(
- model='gpt-4.1-mini',
- api_key=api_key,
- azure_endpoint=azure_endpoint,
-)
async def main():
email_controller = EmailController()
-
- agent = Agent(
- task=TASK,
- controller=email_controller,
- llm=llm,
- )
+ llm = ChatOpenAI(model='gpt-4.1-mini')
+ agent = Agent(task=TASK, controller=email_controller, llm=llm)
await agent.run()