MultiON은 다양한 웹 서비스 및 애플리케이션과 상호작용할 수 있는 AI Agent를 구축했습니다. 이 노트북은 브라우저에서 LangChain을 MultiOn Client에 연결하는 방법을 안내합니다. 이를 통해 MultiON agent의 강력한 기능을 활용하는 맞춤형 agentic workflow를 구현할 수 있습니다. 이 toolkit을 사용하려면 브라우저에 MultiOn Extension을 추가해야 합니다:
pip install -qU  multion langchain -q
pip install -qU langchain-community
from langchain_community.agent_toolkits import MultionToolkit

toolkit = MultionToolkit()
toolkit
MultionToolkit()
tools = toolkit.get_tools()
tools
[MultionCreateSession(), MultionUpdateSession(), MultionCloseSession()]

MultiOn 설정

계정을 생성한 후, app.multion.ai/에서 API key를 생성하세요. 로그인하여 extension과의 연결을 설정하세요.
# Authorize connection to your Browser extention
import multion

multion.login()
Logged in.

Agent 내에서 Multion Toolkit 사용하기

이는 MultiON chrome extension을 사용하여 원하는 작업을 수행합니다. 아래 코드를 실행하고 trace를 확인하면 다음을 볼 수 있습니다:
  • agent가 create_multion_session tool을 사용합니다
  • 그런 다음 MultiON을 사용하여 쿼리를 실행합니다
from langchain_classic import hub
from langchain.agents import AgentExecutor, create_openai_functions_agent
from langchain_openai import ChatOpenAI
# Prompt
instructions = """You are an assistant."""
base_prompt = hub.pull("langchain-ai/openai-functions-template")
prompt = base_prompt.partial(instructions=instructions)
# LLM
llm = ChatOpenAI(temperature=0)
# Agent
agent = create_openai_functions_agent(llm, toolkit.get_tools(), prompt)
agent_executor = AgentExecutor(
    agent=agent,
    tools=toolkit.get_tools(),
    verbose=False,
)
agent_executor.invoke(
    {
        "input": "Use multion to explain how AlphaCodium works, a recently released code language model."
    }
)
WARNING: 'new_session' is deprecated and will be removed in a future version. Use 'create_session' instead.
WARNING: 'update_session' is deprecated and will be removed in a future version. Use 'step_session' instead.
WARNING: 'update_session' is deprecated and will be removed in a future version. Use 'step_session' instead.
WARNING: 'update_session' is deprecated and will be removed in a future version. Use 'step_session' instead.
WARNING: 'update_session' is deprecated and will be removed in a future version. Use 'step_session' instead.
{'input': 'Use multion to how AlphaCodium works, a recently released code language model.',
 'output': 'AlphaCodium is a recently released code language model that is designed to assist developers in writing code more efficiently. It is based on advanced machine learning techniques and natural language processing. AlphaCodium can understand and generate code in multiple programming languages, making it a versatile tool for developers.\n\nThe model is trained on a large dataset of code snippets and programming examples, allowing it to learn patterns and best practices in coding. It can provide suggestions and auto-complete code based on the context and the desired outcome.\n\nAlphaCodium also has the ability to analyze code and identify potential errors or bugs. It can offer recommendations for improving code quality and performance.\n\nOverall, AlphaCodium aims to enhance the coding experience by providing intelligent assistance and reducing the time and effort required to write high-quality code.\n\nFor more detailed information, you can visit the official AlphaCodium website or refer to the documentation and resources available online.\n\nI hope this helps! Let me know if you have any other questions.'}

Connect these docs programmatically to Claude, VSCode, and more via MCP for real-time answers.
I