kernl

Function: tool()

function tool<TContext, TParameters, TResult>(config: ToolConfig<TContext, TParameters, TResult>): FunctionTool<TContext, TParameters, TResult>;

Defined in: packages/kernl/src/tool/tool.ts:34

Exposes a function to the agent as a tool to be called

Type Parameters

Type ParameterDefault type
TContextunknown
TParameters extends ToolInputParametersundefined
TResultstring

Parameters

ParameterTypeDescription
configToolConfig<TContext, TParameters, TResult>The options for the tool

Returns

FunctionTool<TContext, TParameters, TResult>

A new tool instance

On this page