A2uiFunctionDefinition


interface A2uiFunctionDefinition


Represents the definition and schema of a function supported by A2UI.

Summary

Public properties

open Boolean

Indicates if this function should execute even if some of its data-bound arguments cannot be resolved (e.g., data is not yet available for a dynamic property).

A2uiSchema

The schema of the arguments expected by the component.

String

Describes the function behavior so the AI agent knows when to use it.

String

Function name that would be provided to the AI agent.

A2uiFunctionReturnType

The type of the value returned by the function.

Extension functions

A2uiSchema

Converts this function definition into an A2uiSchema.

Public properties

acceptsUnresolvedArguments

Added in 1.0.0-alpha01
open val acceptsUnresolvedArgumentsBoolean

Indicates if this function should execute even if some of its data-bound arguments cannot be resolved (e.g., data is not yet available for a dynamic property).

When false (default), if any argument cannot be resolved, evaluation halts and returns null indicating to the component that it should wait in a loading state.

When true, arguments whose data bindings cannot be resolved are omitted from the arguments map passed to A2uiFunction.execute, allowing the function to execute with the remaining resolved arguments.

argumentSchema

Added in 1.0.0-alpha01
val argumentSchemaA2uiSchema

The schema of the arguments expected by the component.

description

Added in 1.0.0-alpha01
val descriptionString

Describes the function behavior so the AI agent knows when to use it.

name

Added in 1.0.0-alpha01
val nameString

Function name that would be provided to the AI agent.

returnType

Added in 1.0.0-alpha01
val returnTypeA2uiFunctionReturnType

The type of the value returned by the function.

Extension functions

A2uiFunctionDefinition.toSchema

fun A2uiFunctionDefinition.toSchema(): A2uiSchema

Converts this function definition into an A2uiSchema.

Returns
A2uiSchema

the A2uiSchema representation of this function definition