A2uiState

@Stable
class A2uiState(val catalog: A2uiCatalog = A2uiCatalog.Basic, catalogs: List<A2uiCatalog> = emptyList())(source)

The renderer side of an A2UI session: feed it agent-to-renderer messages (process), render its surfaces with A2uiSurfaceView. Messages it must answer (function responses, errors) come back from process as renderer-to-agent messages for the transport to send.

Constructors

Link copied to clipboard
constructor(catalog: A2uiCatalog = A2uiCatalog.Basic, catalogs: List<A2uiCatalog> = emptyList())

Properties

Link copied to clipboard
Link copied to clipboard

Live surfaces, in creation order.

Functions

Link copied to clipboard
fun process(message: JsonElement): List<JsonObject>

Apply one agent-to-renderer message; returns renderer-to-agent replies (usually none).

Link copied to clipboard
fun processText(text: String): List<JsonObject>

Process messages given as text: JSONL, concatenated or pretty-printed JSON objects, or a JSON array of messages. Incomplete trailing input (a message still streaming) is left out.

Link copied to clipboard