AIAgentNodeDelegate

open class AIAgentNodeDelegate<Input, Output>(val name: String?, val inputType: KType, val outputType: KType, val execute: suspend AIAgentGraphContextBase.(Input) -> Output)(source)

A delegate for creating and managing an instance of AIAgentNodeBase.

This class simplifies the instantiation and management of AI agent nodes. It leverages property delegation to lazily initialize a node instance. The node's name can either be explicitly provided or derived from the delegated property name.

Parameters

Input

The type of input data the delegated node will process.

Output

The type of output data the delegated node will produce.

name

The optional name of the node. If not provided, the name will be derived from the property to which the delegate is applied.

Constructors

Link copied to clipboard
constructor(name: String?, inputType: KType, outputType: KType, execute: suspend AIAgentGraphContextBase.(Input) -> Output)

Initializes the delegate with the provided node name and builder.

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val name: String?
Link copied to clipboard

Functions

Link copied to clipboard
operator fun getValue(thisRef: Any?, property: KProperty<*>): AIAgentNodeBase<Input, Output>

Retrieves an instance of AIAgentNodeBase associated with the given property. This operator function acts as a delegate to dynamically provide a reference to an AI agent node.

Link copied to clipboard
inline fun <T> transform(noinline transformation: suspend (Output) -> T): AIAgentNodeDelegate<Input, T>

Creates a transformed version of this node delegate that applies a transformation to the output.