Agents

LangChain tools overview 🦜️🔗

It is possible to convert LangChain Tools into dingo-compatible functions (referred to as function descriptors) in order to register them with Dingo. The converter can be used as follows:

  1. Install langchain:
pip install agent_dingo[langchain]
  1. Define the tool, we will use the Wikipedia tool as an example:
from langchain.tools.wikipedia.tool import WikipediaQueryRun
from langchain.utilities.wikipedia import WikipediaAPIWrapper
tool = WikipediaQueryRun(api_wrapper = WikipediaAPIWrapper())

Please refer to the LangChain documentation for more details on how to define the tools.

  1. Convert the tool into a function descriptor and register:
from agent_dingo.agent.langchain import convert_langchain_tool
descriptor = convert_langchain_tool(tool)
agent.register_descriptor(descriptor)
Previous
Agents overview