convert_runnable_to_tool#
- langchain_core.tools.convert.convert_runnable_to_tool(runnable: Runnable, args_schema: type[BaseModel] | None = None, *, name: str | None = None, description: str | None = None, arg_types: dict[str, type] | None = None) BaseTool [source]#
Convert a Runnable into a BaseTool.
- Parameters:
runnable (Runnable) β The runnable to convert.
args_schema (type[BaseModel] | None) β The schema for the toolβs input arguments. Defaults to None.
name (str | None) β The name of the tool. Defaults to None.
description (str | None) β The description of the tool. Defaults to None.
arg_types (dict[str, type] | None) β The types of the arguments. Defaults to None.
- Returns:
The tool.
- Return type: