autogen_ext.agents.web_surfer#
- class 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.', 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, animate_actions: bool = False, use_ocr: bool = True, to_resize_viewport: bool = True, playwright: Playwright | None = None, context: BrowserContext | None = None)[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 on_messages(messages: Sequence[Annotated[TextMessage | MultiModalMessage | StopMessage | HandoffMessage, FieldInfo(annotation=NoneType, required=True, discriminator='type')]], cancellation_token: CancellationToken) Response [source]#
Handles incoming messages and returns a response.
- async on_reset(cancellation_token: CancellationToken) None [source]#
Resets the agent to its initialization state.
- property produced_message_types: List[type[Annotated[TextMessage | MultiModalMessage | StopMessage | HandoffMessage, FieldInfo(annotation=NoneType, required=True, discriminator='type')]]]#
The types of messages that the agent produces.