Overview
TheMultiOnTool
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:Steps to Get Started
To effectively use theMultiOnTool
, follow these steps:
- Install CrewAI: Ensure that the
crewai[tools]
package is installed in your Python environment. - Install and use MultiOn: Follow MultiOn documentation for installing the MultiOn Browser Extension.
- 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
TheMultiOnTool
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 isFalse
. - max_steps: Optional. Sets the maximum number of steps the MultiOn agent can take for a command. Default is
3
.
Usage
When using theMultiOnTool
, 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
CONTINUE
, the agent should be instructed to reissue the same instruction to continue execution.
Implementation Details
TheMultiOnTool
is implemented as a subclass of BaseTool
from CrewAI. It wraps the MultiOn client to provide web browsing capabilities:
Code
Conclusion
TheMultiOnTool
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.