onMultipleAssistantMessages
infix fun <IncomingOutput, OutgoingInput> AIAgentEdgeBuilderIntermediate<IncomingOutput, List<Message.Response>, OutgoingInput>.onMultipleAssistantMessages(block: suspend (List<Message.Assistant>) -> Boolean): AIAgentEdgeBuilderIntermediate<IncomingOutput, List<Message.Assistant>, OutgoingInput>(source)
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
inline fun AIAgentFunctionalContext.onMultipleAssistantMessages(response: List<Message.Response>, action: (List<Message.Assistant>) -> Unit)(source)
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.