Skip to main content

MultiOn

This notebook walks you through connecting LangChain to the MultiOn Client in your browser

To use this toolkit, you will need to add MultiOn Extension to your browser as explained in the MultiOn for Chrome.

pip install --upgrade multion langchain -q
from langchain.agents.agent_toolkits import MultionToolkit
import os


toolkit = MultionToolkit()

toolkit

API Reference:

tools = toolkit.get_tools()
tools

MultiOn Setup

Login to establish connection with your extension.

# Authorize connection to your Browser extention
import multion
multion.login()

Use Multion Toolkit within an Agent

from langchain.llms import OpenAI
from langchain.agents import initialize_agent, AgentType
llm = OpenAI(temperature=0)
from langchain.agents.agent_toolkits import MultionToolkit
toolkit = MultionToolkit()
tools=toolkit.get_tools()
agent = initialize_agent(
tools=toolkit.get_tools(),
llm=llm,
agent=AgentType.STRUCTURED_CHAT_ZERO_SHOT_REACT_DESCRIPTION,
verbose = True
)
agent.run(
"Tweet 'Hi from MultiOn'"
)