コンテンツにスキップ

tool

このコンテンツはまだ日本語訳がありません。

function tool<TParameters, Context, Result, TOutputSchema>(options): FunctionTool<Context, TParameters, ToolExecuteResult<TOutputSchema, Result>>;

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

Type Parameter Default type

TParameters extends ToolInputParameters

undefined

Context

unknown

Result

string

TOutputSchema extends | ToolOutputSchema | undefined

undefined

Parameter Type Description

options

ToolOptions<TParameters, Context, TOutputSchema>

The options for the tool

FunctionTool<Context, TParameters, ToolExecuteResult<TOutputSchema, Result>>

A new tool