addToolAction

fun <Args : Tool.Args, Result : ToolResult> addToolAction(tool: Tool<Args, Result>, argsCondition: suspend (Args) -> Boolean = { true }, action: suspend (Args) -> Result)(source)

Adds a tool action to be executed when a tool call matches the specified condition.

Parameters

tool

The tool to be mocked

argsCondition

A function that determines if the tool call arguments match this action

action

A function that produces the result when the condition is satisfied