autogen_ext.agents#
- class autogen_ext.agents.MultimodalWebSurfer(name: str, model_client: ChatCompletionClient, description: str = 'A helpful assistant with access to a web browser. Ask them to perform web searches, open pages, and interact with content (e.g., clicking links, scrolling the viewport, etc., filling in form fields, etc.) It can also summarize the entire page, or answer questions based on the content of the page. It can also be asked to sleep and wait for pages to load, in cases where the pages seem to be taking a while to load.')[source]#
Bases:
BaseChatAgent
(In preview) A multimodal agent that acts as a web surfer that can search the web and visit web pages.
- DEFAULT_DESCRIPTION = 'A helpful assistant with access to a web browser. Ask them to perform web searches, open pages, and interact with content (e.g., clicking links, scrolling the viewport, etc., filling in form fields, etc.) It can also summarize the entire page, or answer questions based on the content of the page. It can also be asked to sleep and wait for pages to load, in cases where the pages seem to be taking a while to load.'#
- DEFAULT_START_PAGE = 'https://www.bing.com/'#
- async init(headless: bool = True, browser_channel: str | None = None, browser_data_dir: str | None = None, start_page: str | None = None, downloads_folder: str | None = None, debug_dir: str | None = '/home/runner/work/autogen/autogen/python/packages/autogen-core', to_save_screenshots: bool = False) None [source]#
Initialize the MultimodalWebSurfer.
- Parameters:
headless (bool) – Whether to run the browser in headless mode. Defaults to True.
browser_channel (str | type[DEFAULT_CHANNEL]) – The browser channel to use. Defaults to DEFAULT_CHANNEL.
browser_data_dir (str | None) – The directory to store browser data. Defaults to None.
start_page (str | None) – The initial page to visit. Defaults to DEFAULT_START_PAGE.
downloads_folder (str | None) – The folder to save downloads. Defaults to None.
debug_dir (str | None) – The directory to save debug information. Defaults to the current working directory.
to_save_screenshots (bool) – Whether to save screenshots. Defaults to False.
- async on_messages(messages: Sequence[TextMessage | MultiModalMessage | StopMessage | HandoffMessage], cancellation_token: CancellationToken) Response [source]#
Handles incoming messages and returns a response.
- property produced_message_types: List[type[TextMessage | MultiModalMessage | StopMessage | HandoffMessage]]#
The types of messages that the agent produces.