AIAgentNodeDelegate

constructor(name: String?, inputType: TypeToken, outputType: TypeToken, execute: suspend AIAgentGraphContextBase.(Input) -> Output)(source)

Initializes the delegate with the provided node name and builder.

Parameters

name

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

Type Parameters

Input

The type of input data the delegated node will process.

Output

The type of output data the delegated node will produce.


constructor(name: String?, inputType: KType, outputType: KType, execute: suspend AIAgentGraphContextBase.(Input) -> Output)(source)

Deprecated

Use TypeToken for inputType and outputType

Secondary constructor for AIAgentNodeDelegate that allows direct specification of input and output types as KType instead of using ai.koog.serialization.KotlinTypeToken.

This constructor is marked as deprecated because the use of ai.koog.serialization.KotlinTypeToken for inputType and outputType is preferred to streamline type handling and improve interface consistency.

Parameters

name

An optional name associated with the node delegate.

inputType

The KType representing the expected input type for the node.

outputType

The KType representing the expected output type for the node.

execute

A suspend function defining the execution logic for the node, operating within the scope of an AIAgentGraphContextBase and transforming an Input into an Output.

See also

KotlinTypeToken

Throws

If any of the provided parameters are invalid for the context of the node delegate.