Agent output

An agent produces output with the output command. Output is streamed to the user as multipart content. Each part is written to the stream the moment the command runs, and the client — the GUI or a chat application — renders the part immediately.

Output is append-only and keeps its order. The supported parts are text, HTML, images, and whatever an llm command with streamOutput produces.

Text

Text is the default part. Text is interpreted as Markdown, which is what LLMs produce.

"output": "The answer to your question is **42**"

The same text, written as a part object:

"output": {
  "contentType": "text",
  "text": "The answer to your question is **42**"
}

HTML

HTML is rendered after harmful content is removed. Markdown is not applied to HTML.

"output": {
  "contentType": "html",
  "text": "The answer to your question is <b>42</b>"
}

Images

Images are emitted as base64-encoded data with an explicit MIME type.

"output": {
  "contentType": "image",
  "mimeType": "image/png",
  "text": "iVBORw0KGgoAAAANSUhEUgAAAZAAAAGQCAYAAACAvzbMAAAB..."
}

Several parts at once

A list appends each element as a part. A string in the list becomes a text part.

Progress, trace and log are not output

progress sends a transient message that the user sees while the agent runs. The message is not saved with the conversation. trace writes to the developer's execution trace during validation and does nothing in production. log writes to the agent server's log. Only output becomes part of the answer, plus end, which appends its value to the output.