onMultipleAssistantMessages

Creates an edge that filters assistant messages based on a custom condition and extracts their content.

Parameters

block

A function that evaluates whether to accept an assistant message


Filters the provided list of response messages to include only assistant messages and, if the filtered list is not empty, performs the specified action with the filtered list.

Parameters

response

A list of response messages to be processed. Only those of type Message.Assistant will be considered.

action

A lambda function to execute on the list of assistant messages if the filtered list is not empty.