ofResult

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.

Any tool's result qualifies, not only render_a2ui's: upstream's LangGraph adapter returns a2ui_operations from a generate_a2ui tool, and a fixed-schema agent returns them from search_flights. What makes a result A2UI is its content, not the tool's name. A result that is JSON-encoded twice -- a string holding the object -- is read through one extra decode, because that is a shape upstream's own parser accepts.