onMultipleToolCalls

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


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.