Skip to main content

Overview

The MultiOnTool is designed to wrap MultiOn’s web browsing capabilities, enabling CrewAI agents to control web browsers using natural language instructions. This tool facilitates seamless web browsing, making it an essential asset for projects requiring dynamic web data interaction and automation of web-based tasks.

Installation

To use this tool, you need to install the MultiOn package:
You’ll also need to install the MultiOn browser extension and enable API usage.

Steps to Get Started

To effectively use the MultiOnTool, follow these steps:
  1. Install CrewAI: Ensure that the crewai[tools] package is installed in your Python environment.
  2. Install and use MultiOn: Follow MultiOn documentation for installing the MultiOn Browser Extension.
  3. Enable API Usage: Click on the MultiOn extension in the extensions folder of your browser (not the hovering MultiOn icon on the web page) to open the extension configurations. Click the API Enabled toggle to enable the API.

Example

The following example demonstrates how to initialize the tool and execute a web browsing task:
Code

Parameters

The MultiOnTool accepts the following parameters during initialization:
  • api_key: Optional. Specifies the MultiOn API key. If not provided, it will look for the MULTION_API_KEY environment variable.
  • local: Optional. Set to True to run the agent locally on your browser. Make sure the MultiOn browser extension is installed and API Enabled is checked. Default is False.
  • max_steps: Optional. Sets the maximum number of steps the MultiOn agent can take for a command. Default is 3.

Usage

When using the MultiOnTool, the agent will provide natural language instructions that the tool translates into web browsing actions. The tool returns the results of the browsing session along with a status.
Code
If the status returned is CONTINUE, the agent should be instructed to reissue the same instruction to continue execution.

Implementation Details

The MultiOnTool is implemented as a subclass of BaseTool from CrewAI. It wraps the MultiOn client to provide web browsing capabilities:
Code

Conclusion

The MultiOnTool provides a powerful way to integrate web browsing capabilities into CrewAI agents. By enabling agents to interact with websites through natural language instructions, it opens up a wide range of possibilities for web-based tasks, from data collection and research to automated interactions with web services.