Companion

object Companion

Functions

Link copied to clipboard
fun of(part: ActivityPart, translation: A2uiTranslation = A2uiTranslation.Default): A2uiPayload?

The payload an a2ui-surface activity carries, or null when part is some other kind of activity.

Link copied to clipboard
fun ofArguments(part: ToolCallPart, translation: A2uiTranslation = A2uiTranslation.Default, toolNames: Set<String> = setOf(AguiA2ui.RENDER_TOOL_NAME)): A2uiPayload?

The payload a render_a2ui call's arguments carry: Building while they stream, Surfaces once they have parsed. Null when part is not a render call, and also when the call has been reported failed -- there is nothing to draw for a call that did not happen, and the tool-call slot already says so.

Link copied to clipboard
fun ofResult(part: ToolCallPart, translation: A2uiTranslation = A2uiTranslation.Default): A2uiPayload?

The payload a tool result carries, or null when the result is absent or is not A2UI.