onCondition

Filters the intermediate outputs of the ai.koog.agents.core.agent.entity.AIAgentNode based on a specified condition.

Return

A new instance of AIAgentEdgeBuilderIntermediate that includes only the filtered intermediate outputs satisfying the specified condition.

Parameters

block

A suspending lambda function that takes the AI agent's context and an intermediate output as parameters. It returns true if the given intermediate output satisfies the condition, and false otherwise.