LangChainInteroperability

LangChainInteroperability()

A class implementing the Interoperable protocol for converting Langchain tools into a general Tool format.

This class takes a LangchainTool and converts it into a standard Tool object, ensuring compatibility between Langchain tools and other systems that expect the Tool format.

Static Methods

convert_tool

convert_tool(tool: Any, **kwargs: Any) -> autogen.tools.tool.Tool

Converts a given Langchain tool into a general Tool format.

This method verifies that the provided tool is a valid LangchainTool, processes the tool’s input and description, and returns a standardized Tool object.

Parameters:
NameDescription
toolThe tool to convert, expected to be an instance of LangchainTool.

Type: Any
**kwargsAdditional arguments, which are not supported by this method.

Type: Any
Returns:
TypeDescription
autogen.tools.tool.ToolTool: A standardized Tool object converted from the Langchain tool.

get_unsupported_reason

get_unsupported_reason() -> str | None