Types

Link copied to clipboard
@SerialName(value = "data")
class Data(val type: String, val data: JsonElement, val providerMetadata: ProviderMetadata = ProviderMetadata.None, val id: String? = null, val transient: Boolean = false) : UIMessagePart

Typed custom data part. Mirrors v6 data-* UI parts while using an explicit type string instead of TypeScript literal keys.

Link copied to clipboard
@SerialName(value = "dynamic-tool")
class DynamicToolUI(val toolCallId: String, val toolName: String, val state: ToolCallState, val input: JsonElement? = null, val output: JsonElement? = null, val error: String? = null, val preliminary: Boolean = false, val providerMetadata: ProviderMetadata = ProviderMetadata.None) : UIMessagePart

Runtime-typed tool invocation — same lifecycle shape as ToolUI but for tools whose schema isn't known at compile time (the common case in subagents, where the parent agent's static ToolPartHandlerRegistry can't dispatch). Renderers branch on is DynamicToolUI and fall back to a generic "Calling toolName…" card with JSON-printed input / output. Per historical parity gap #9.

Link copied to clipboard
@SerialName(value = "error")
class Error(val message: String) : UIMessagePart
Link copied to clipboard
@SerialName(value = "file")
class File(val mediaType: String, val base64: String, val filename: String? = null, val providerMetadata: ProviderMetadata = ProviderMetadata.None) : UIMessagePart

Generated file (image, audio, etc.).

Link copied to clipboard
@SerialName(value = "reasoning")
class Reasoning(val text: String, val state: TextUIPartState = TextUIPartState.Done, val providerMetadata: ProviderMetadata = ProviderMetadata.None) : UIMessagePart
Link copied to clipboard
@SerialName(value = "source-document")
class SourceDocument(val sourceId: String, val mediaType: String, val title: String, val filename: String? = null, val providerMetadata: ProviderMetadata = ProviderMetadata.None) : UIMessagePart

Document-shaped source — a referenced file the model used as grounding (PDF, image, etc.). Per v6's SourceDocumentUIPart. Distinct from File which carries the file's payload — this variant is a CITATION POINTER to a document the model read, not a file the model produced.

Link copied to clipboard
@SerialName(value = "source-url")
class SourceUrl(val sourceId: String, val url: String, val title: String? = null, val providerMetadata: ProviderMetadata = ProviderMetadata.None) : UIMessagePart

URL-shaped citation / web grounding source. Per historical parity gap #29, this is the split from a single unified Source variant — v6's SourceUrlUIPart.

Link copied to clipboard
@SerialName(value = "step-start")
class StepStart(val stepNumber: Int) : UIMessagePart

Step boundary marker — emitted between LLM call iterations when the agent does multi-step work (tool-call → tool-result → next LLM call). Preserves the v6 step-start UI part so a subagent handoff or multi-tool flow can render a visible divider in the chat list. Per historical parity gap #8.

Link copied to clipboard
@SerialName(value = "text")
class Text(val text: String, val state: TextUIPartState = TextUIPartState.Done, val providerMetadata: ProviderMetadata = ProviderMetadata.None) : UIMessagePart
Link copied to clipboard
@SerialName(value = "tool")
class ToolUI(val toolCallId: String, val toolName: String, val state: ToolCallState, val input: JsonElement? = null, val output: JsonElement? = null, val error: String? = null, val preliminary: Boolean = false, val approvalId: String? = null, val signature: String? = null, val providerMetadata: ProviderMetadata = ProviderMetadata.None) : UIMessagePart

One tool call's full lifecycle in the UI. State progresses InputStreaming → InputAvailable → OutputAvailable (or Error, or ApprovalRequired when the loop is paused on user decision). Component renderers can show the same card across states ("Looking up lineup..." → "Found 12 sets" → final card).