onMultipleToolCalls
infix fun <IncomingOutput, OutgoingInput> AIAgentEdgeBuilderIntermediate<IncomingOutput, List<Message.Response>, OutgoingInput>.onMultipleToolCalls(block: suspend (List<Message.Tool.Call>) -> Boolean): AIAgentEdgeBuilderIntermediate<IncomingOutput, List<Message.Tool.Call>, OutgoingInput>(source)
Creates an edge that filters lists of tool call messages based on a custom condition.
Parameters
block
A function that evaluates whether to accept a list of tool call messages
inline fun AIAgentFunctionalContext.onMultipleToolCalls(response: List<Message.Response>, action: (List<Message.Tool.Call>) -> Unit)(source)
Invokes the provided action when multiple tool call messages are found within a given list of response messages. Filters the list of responses to include only instances of Message.Tool.Call and executes the action on the filtered list if it is not empty.
Parameters
response
A list of response messages to be checked for tool call messages.
action
A lambda function to be executed with the list of filtered tool call messages, if any exist.