AIUIComponentDefinition

data class AIUIComponentDefinition(val name: String, val description: String, val parameters: List<AIUIParameter> = emptyList(), val events: List<AIUIComponentDefinition.Event> = emptyList())

A component's description, the same on every platform and for the agent: its name, what it shows, the parameters the agent fills in and the events it reports.

It reads and writes JSON, so one description can be shared by every platform an app runs on and by the agent's backend. Its parameters are a JSON Schema object, as a tool's are, which keeps their order in x-order:

{
"name": "place_card",
"description": "A photo and a short summary of a place.",
"parameters": {
"type": "object",
"properties": { "title": { "type": "string", "description": "The place's Wikipedia title." } },
"required": ["title"],
"x-order": ["title"]
},
"events": [{ "name": "ask_about", "description": "The person asks about the place." }]
}

Parameters

name

The name the agent places it by, such as place_card.

description

What it shows and when to use it, for the agent.

parameters

What the agent fills in, in order: a format such as OpenUI Lang passes arguments by position.

events

What it reports when the person uses it.

Constructors

Link copied to clipboard
constructor(name: String, description: String, parameters: List<AIUIParameter> = emptyList(), events: List<AIUIComponentDefinition.Event> = emptyList())

Types

Link copied to clipboard
object Companion
Link copied to clipboard
data class Event(val name: String, val description: String, val parameters: List<AIUIParameter> = emptyList())

Something a component reports when the person uses it, such as tapping a place.

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

The parameters as a JSON Schema object, the way a tool's are described.

Functions

Link copied to clipboard
fun toJson(): Map<String, Any?>

The definition as its portable JSON, in plain Kotlin values.

Link copied to clipboard

The definition as its portable JSON text, with sorted keys.