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