CompatibleFullAgentEdgeBuilder

Constructs a compatible full agent edge between two AI agent nodes, enabling the flow and transformation of data from the output of one node to the input of another.

Parameters

fromNode

The source AI agent node, which emits data that needs to be forwarded.

toNode

The destination AI agent node, which receives the forwarded data.

forwardOutputComposition

A transformation function that takes the graph execution context and the output from the source node, and produces an optional intermediate compatible output.

Type Parameters

IncomingOutput

The type of the output data produced by the source node.

CompatibleOutput

An intermediate type ensuring compatibility between the source node and destination node, derived from the source node's output.

OutgoingInput

The type of the input data expected by the destination node.

Functions

Link copied to clipboard
fun asToolResultMessage(condition: SimpleCondition<ReceivedToolResult> = { true }): FullAgentEdgeBuilder<IncomingOutput, ERROR CLASS: Symbol not found for Message.User, OutgoingInput>

Creates an edge that transforms an intermediate output into a Message.User using the provided transform.

Link copied to clipboard
fun asUserMessage(transformation: SimpleTransformation<CompatibleOutput, String> = { it.toString() }): FullAgentEdgeBuilder<IncomingOutput, ERROR CLASS: Symbol not found for Message.User, OutgoingInput>

Creates an edge that transforms an intermediate output into a Message.User using the provided transform.

Link copied to clipboard

Constructs and finalizes an AIAgentEdge connecting the specified source and destination nodes.

Link copied to clipboard

Applies a contextual condition to filter the output being processed and forwarded within the graph.

Attaches a condition that filters intermediate outputs before they are propagated to the target node within the agent's processing graph.

Link copied to clipboard

Filters the outputs of the current processing edge based on their type, forwarding only those that are instances of the specified class.

Filters intermediate outputs to only process those that are instances of the specified class type.

Link copied to clipboard
fun <T : ERROR CLASS: Symbol not found for MessagePart> onMessageParts(clazz: Class<T>): FullAgentEdgeBuilder<IncomingOutput, List<T>, OutgoingInput>

Filters the intermediate output to only Message instances that contain parts of type T, and transforms the output to a list of those parts.

Link copied to clipboard

Creates an edge that extracts text content from message parts.

Link copied to clipboard
fun onToolCalls(condition: SimpleCondition<ERROR CLASS: Symbol not found for MessagePart.Tool.Call> = { true }): FullAgentEdgeBuilder<IncomingOutput, ToolCalls, OutgoingInput>

Creates an edge that filters assistant messages containing tool calls matching the provided condition. The default condition onToolCalls { true } accepts any message with at least one tool call.

Link copied to clipboard

Transforms the intermediate output of the edge by applying the given action. This is an alias for transformed providing naming consistency with the node builder API.