ExAthena.Messages.ToolResult (ExAthena v0.5.0)

Copy Markdown View Source

The outcome of a tool execution, replayed back to the model.

content is the LLM-facing text — what the model sees on the next iteration. ui_payload is an optional structured map that hosts (TUIs, LiveView frontends) can render as rich content (diffs, file previews, process output) without parsing the text.

ui_payload is nil for tools that only return text; the loop only emits :tool_ui events when a payload is present.

Summary

Types

t()

@type t() :: %ExAthena.Messages.ToolResult{
  content: String.t(),
  is_error: boolean() | nil,
  tool_call_id: String.t(),
  ui_payload: ui_payload() | nil
}

ui_payload()

@type ui_payload() :: %{kind: atom(), payload: map()}