AIUIDocument

data class AIUIDocument(val format: AIUIFormat, val version: String? = null, val isStreaming: Boolean = false, val content: Any?)

The UI a reply shows in place of its text, which the agent wrote in a format such as OpenUI.

The agent's backend writes it in the reply's ai_ui custom field. The reply's text stays readable on its own, for wherever the UI can't show, such as a push notification or an app without a renderer for the format:

"ai_ui": { "v": 1, "format": "openui", "status": "streaming", "content": "root = Card([title])" }
override val uiDocument: AIUIDocument? get() = AIUIDocument.from(message.extraData)

Parameters

format

The format it is written in.

version

The format's version, when the agent names one.

isStreaming

Whether the agent is still writing it.

content

The document in its format's own shape: a program's text, or JSON as plain Kotlin values (maps, lists, strings, numbers, booleans and null).

Constructors

Link copied to clipboard
constructor(format: AIUIFormat, version: String? = null, isStreaming: Boolean = false, content: Any?)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val content: Any?
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val text: String?

The content when it is text, such as an OpenUI program.

Link copied to clipboard