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." }]
}Content copied to clipboard
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())