diff --git a/.gitignore b/.gitignore index 2136e926e..c26532221 100644 --- a/.gitignore +++ b/.gitignore @@ -40,3 +40,5 @@ private_example.py private_example uv.lock +temp +tmp diff --git a/browser_use/agent/service.py b/browser_use/agent/service.py index 34aadbaae..81a2a376f 100644 --- a/browser_use/agent/service.py +++ b/browser_use/agent/service.py @@ -13,6 +13,8 @@ from typing import Any, Generic, TypeVar from dotenv import load_dotenv +from browser_use.browser.session import DEFAULT_BROWSER_PROFILE + load_dotenv() from langchain_core.language_models.chat_models import BaseChatModel @@ -291,7 +293,7 @@ class Agent(Generic[Context]): assert not (browser_profile and browser_context), 'Cannot provide both browser_profile and browser_context' assert not (browser and browser_context), 'Cannot provide both browser and browser_context' assert not (browser_session and browser_context), 'Cannot provide both browser_session and browser_context' - + browser_profile = browser_profile or DEFAULT_BROWSER_PROFILE self.browser_session = browser_session or BrowserSession( profile=browser_profile, browser=browser, browser_context=browser_context ) diff --git a/examples/simple.py b/examples/simple.py index de29003ba..c42bd1dda 100644 --- a/examples/simple.py +++ b/examples/simple.py @@ -17,8 +17,7 @@ llm = ChatOpenAI( model='gpt-4o', temperature=0.0, ) -task = 'Go to kayak.com and find the cheapest flight from Zurich to San Francisco on 2025-05-01' - +task = 'Go to kayak.com and find the cheapest one-way flight from Zurich to San Francisco in 3 weeks.' agent = Agent(task=task, llm=llm)