onCondition
Applies a contextual condition to filter the output being processed and forwarded within the graph.
This method attaches a condition that evaluates whether a given intermediate output should be propagated to the destination node. The condition is evaluated based on the output and the current AI agent graph context.
Return
A builder instance that allows further configuration or chaining of processing steps.
Parameters
A condition to be evaluated for each intermediate output. It takes the output and the context as arguments and returns a boolean indicating whether to propagate the output (true) or filter it out (false).
Attaches a condition that filters intermediate outputs before they are propagated to the target node within the agent's processing graph.
This method applies a simple, stateless condition to determine whether an intermediate output should be forwarded downstream. The condition is evaluated based on the output value.
Return
A builder instance to allow further configuration or chaining of processing steps.
Parameters
A simple condition to evaluate for each intermediate output. It receives an output object as input and returns true if the output should be forwarded, or false if it should be filtered out.