asToolResultMessage

Applies a transformation to the intermediate output of the edge builder and filters the received tool results based on the provided condition. This function is used to handle tool results as a part of the AI agent's edge flow within the DSL.

Return

A new instance of AIAgentEdgeBuilderIntermediate with the intermediate output type set to ReceivedToolResults, representing a collection of filtered tool results.

Parameters

filter

A suspending lambda function that determines whether a given ReceivedToolResult should be included in the transformation process. The function takes a ReceivedToolResult as input and returns a Boolean indicating whether the result satisfies the filter condition.