The runnable to convert to a tool.
The Zod schema for the input of the tool. Either the schema itself or a ZodString.
Optional
description?: stringThe description of the tool. If not provided, it will default to Takes {schema}
where schema
is a JSON string representation of the input schema.
Optional
name?: stringThe name of the tool. If not provided, it will default to the name of the runnable.
The tool created from the runnable. DynamicTool if the schema is a ZodString, DynamicStructuredTool if the schema is a ZodType.
Given a runnable and a Zod schema, convert the runnable to a tool.