UIMessage

data class UIMessage(val id: String, val role: UIMessageRole, val parts: List<UIMessagePart>, val createdAtMs: Long = 0, val metadata: Map<String, JsonElement>? = null)(source)

UI-shape message — what the chat surface renders. Carries an ordered list of UIMessageParts (Vercel AI SDK v6 message-parts model). The conversion from ai.torad.aisdk.StreamEvent flow into a growing list of these messages happens in streamToUiMessages.

The optional metadata slot is the Kotlin port's monomorphic substitute for v6's UIMessage<METADATA, DATA_PARTS, TOOLS> generics (per historical parity gap #10). Subagents attach their source-agent identity here; UI renderers can read it to chrome "Agent X -> Agent Y" handoff banners. Arbitrary keys are allowed; apps should prefix custom keys with their own namespace.

Constructors

Link copied to clipboard
constructor(id: String, role: UIMessageRole, parts: List<UIMessagePart>, createdAtMs: Long = 0, metadata: Map<String, JsonElement>? = null)

Properties

Link copied to clipboard
Link copied to clipboard
val id: String
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard