Skip to main content

Function: hasToolCall()

hasToolCall<TOOLS>(...toolName): StopCondition<TOOLS, any>

Defined in: node_modules/.bun/ai@7.0.147+68a1e3a0c4588df3/node_modules/ai/dist/index.d.ts:3321

Creates a stop condition that returns true when the most recent step contains a tool call with any of the specified names.

Type Parameters​

TOOLS​

TOOLS extends ToolSet

Parameters​

toolName​

...(string & object | keyof TOOLS)[]

The names of the tools that should stop the loop.

Returns​

StopCondition<TOOLS, any>