UiPart

sealed interface UiPart

One renderable piece of a message, in the position the agent emitted it.

The protocol streams text, reasoning and tool calls as three independent event families, each with its own message identifier and no field relating one to another. Their arrival order is the only record that the agent reasoned, then spoke, then called a tool -- so that order is what this model preserves, and UiMessage.parts is the list it is preserved in.

A part carries its own streaming state rather than the message carrying one state for all of it. A tool call can still be running while the text after it is complete, and a renderer that had only a message-level flag would have to choose which of the two to believe.

Inheritors

Properties

Link copied to clipboard
abstract val id: String

Stable across the whole life of the part, including while it streams.