onAssistantMessage

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


Executes the provided action if the given response is of type Message.Assistant.

Parameters

response

The response message to evaluate, which may or may not be of type Message.Assistant.

action

A lambda function to execute if the response is an instance of Message.Assistant.