onMultipleToolCalls
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.