onToolCalls
infix fun <IncomingOutput, IntermediateOutput, OutgoingInput> AIAgentEdgeBuilderIntermediate<IncomingOutput, IntermediateOutput, OutgoingInput>.onToolCalls(block: suspend (MessagePart.Tool.Call) -> Boolean): AIAgentEdgeBuilderIntermediate<IncomingOutput, ToolCalls, OutgoingInput>(source)
Creates an edge that filters assistant messages containing tool calls, based on a custom condition. The default condition onToolCalls { true } will create a conditional edge checking that there at list one tool call The custom condition onToolCalls { it.tool == "exit" } will create a conditional edge checking that there is tool call with the name "exit"
Parameters
block
A function that evaluates whether to accept the tool call