diff --git a/autogen/agentchat/contrib/multimodal_web_surfer/multimodal_web_surfer.py b/autogen/agentchat/contrib/multimodal_web_surfer/multimodal_web_surfer.py index 813c0279d..cc623c78d 100644 --- a/autogen/agentchat/contrib/multimodal_web_surfer/multimodal_web_surfer.py +++ b/autogen/agentchat/contrib/multimodal_web_surfer/multimodal_web_surfer.py @@ -67,8 +67,8 @@ class MultimodalWebSurferAgent(ConversableAgent): mlm_config: Optional[Union[Dict, Literal[False]]] = None, # TODO: Remove this default_auto_reply: Optional[Union[str, Dict, None]] = "", headless: bool = True, - chromium_channel=DEFAULT_CHANNEL, - chromium_data_dir: Optional[str] = None, + browser_channel=DEFAULT_CHANNEL, + browser_data_dir: Optional[str] = None, start_page: Optional[str] = None, debug_dir: Optional[str] = None, ): @@ -87,8 +87,8 @@ class MultimodalWebSurferAgent(ConversableAgent): llm_config: The configuration for the LLM. default_auto_reply: The default auto-reply. headless: Whether to run the browser in headless mode. - chromium_channel: The Chromium channel to use. - chromium_data_dir: The Chromium data directory. If None, a new context is created. + browser_channel: The Chromium channel to use. + browser_data_dir: The Chromium data directory. If None, a new context is created. start_page: The start page for the browser. debug_dir: The directory to store debug information. TODO: Clarify behavior on None. """ @@ -111,28 +111,28 @@ class MultimodalWebSurferAgent(ConversableAgent): # Create the playwright instance launch_args = {"headless": headless} - if chromium_channel is not DEFAULT_CHANNEL: - launch_args["channel"] = chromium_channel + if browser_channel is not DEFAULT_CHANNEL: + launch_args["channel"] = browser_channel self._playwright = sync_playwright().start() # Create the context -- are we launching a persistent instance? - if chromium_data_dir is None: - if chromium_channel == "chromium": + if browser_data_dir is None: + if browser_channel == "chromium": browser = self._playwright.chromium.launch(**launch_args) - elif chromium_channel == "firefox": + elif browser_channel == "firefox": browser = self._playwright.firefox.launch(**launch_args) else: raise NotImplementedError( - f"Invalid chromium channel {chromium_channel}. Only chromium and firefox are supported." + f"Invalid chromium channel {browser_channel}. Only chromium and firefox are supported." ) self._context = browser.new_context( user_agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36 Edg/122.0.0.0" ) else: - if chromium_channel == "chromium": - self._context = self._playwright.chromium.launch_persistent_context(chromium_data_dir, **launch_args) - elif chromium_channel == "firefox": - self._context = self._playwright.firefox.launch_persistent_context(chromium_data_dir, **launch_args) + if browser_channel == "chromium": + self._context = self._playwright.chromium.launch_persistent_context(browser_data_dir, **launch_args) + elif browser_channel == "firefox": + self._context = self._playwright.firefox.launch_persistent_context(browser_data_dir, **launch_args) # Create the page self._page = self._context.new_page() diff --git a/samples/apps/try_orc/demo_orc_mmwebsurfer.py b/samples/apps/try_orc/demo_orc_mmwebsurfer.py index ca0e687ef..d895f40a7 100644 --- a/samples/apps/try_orc/demo_orc_mmwebsurfer.py +++ b/samples/apps/try_orc/demo_orc_mmwebsurfer.py @@ -39,8 +39,8 @@ web_surfer = MultimodalWebSurferAgent( is_termination_msg=lambda x: str(x).find("TERMINATE") >= 0 or str(x).find("FINAL ANSWER") >= 0, human_input_mode="NEVER", headless=True, - chromium_channel="chromium", - chromium_data_dir=None, + browser_channel="chromium", + browser_data_dir=None, start_page="https://bing.com", debug_dir=os.path.join(os.path.dirname(__file__), "debug"), ) diff --git a/samples/apps/try_orc/mm_basic.py b/samples/apps/try_orc/mm_basic.py index e1e93ee35..cb26a472d 100644 --- a/samples/apps/try_orc/mm_basic.py +++ b/samples/apps/try_orc/mm_basic.py @@ -14,8 +14,8 @@ web_surfer = MultimodalWebSurferAgent( is_termination_msg=lambda x: str(x).find("TERMINATE") >= 0 or str(x).find("FINAL ANSWER") >= 0, human_input_mode="NEVER", headless=True, - chromium_channel="chromium", - chromium_data_dir=None, + browser_channel="chromium", + browser_data_dir=None, start_page="https://bing.com", debug_dir=os.path.join(os.path.dirname(__file__), "debug"), ) diff --git a/samples/multimodal_browser_chat.py b/samples/multimodal_browser_chat.py index e5bcd3129..c08c4d575 100644 --- a/samples/multimodal_browser_chat.py +++ b/samples/multimodal_browser_chat.py @@ -18,8 +18,8 @@ def main(): llm_config={"config_list": llm_config_list}, is_termination_msg=lambda x: x.get("content", "").rstrip().find("TERMINATE") >= 0, headless=True, - chromium_channel="chromium", - chromium_data_dir=None, + browser_channel="chromium", + browser_data_dir=None, start_page="https://www.bing.com/", debug_dir=os.path.join(os.getcwd(), "debug"), ) diff --git a/samples/tools/autogenbench/scenarios/WebArena/Templates/Orchestrator/scenario.py b/samples/tools/autogenbench/scenarios/WebArena/Templates/Orchestrator/scenario.py index 59bafd5c9..0c60467e5 100644 --- a/samples/tools/autogenbench/scenarios/WebArena/Templates/Orchestrator/scenario.py +++ b/samples/tools/autogenbench/scenarios/WebArena/Templates/Orchestrator/scenario.py @@ -76,8 +76,8 @@ web_surfer = MultimodalWebSurferAgent( is_termination_msg=lambda x: str(x).find("TERMINATE") >= 0 or str(x).find("FINAL ANSWER") >= 0, human_input_mode="NEVER", headless=True, - chromium_channel="chromium", - chromium_data_dir=None, + browser_channel="chromium", + browser_data_dir=None, start_page="https://bing.com", debug_dir=os.path.join(os.path.dirname(__file__), "debug"), ) diff --git a/samples/tools/autogenbench/scenarios/WebArena/Templates/TwoAgents/scenario.py b/samples/tools/autogenbench/scenarios/WebArena/Templates/TwoAgents/scenario.py index e2a692345..2849ce92f 100644 --- a/samples/tools/autogenbench/scenarios/WebArena/Templates/TwoAgents/scenario.py +++ b/samples/tools/autogenbench/scenarios/WebArena/Templates/TwoAgents/scenario.py @@ -55,8 +55,8 @@ web_surfer = MultimodalWebSurferAgent( is_termination_msg=lambda x: str(x).find("TERMINATE") >= 0 or str(x).find("FINAL ANSWER") >= 0, human_input_mode="NEVER", headless=True, - chromium_channel="chromium", - chromium_data_dir=None, + browser_channel="chromium", + browser_data_dir=None, start_page=HOMEPAGE, debug_dir=os.getenv("WEB_SURFER_DEBUG_DIR", None), )