class

Smith::Output::JsonRenderer

Inherits Smith::Output::Renderer < Reference < Object

One JSON object per line on stdout and nothing else, so smith run --json ... | jq works without any pre-filtering. Decoration goes to stderr.

Constructors

new(io : IO = STDOUT, err : IO = STDERR)
Source

Instance methods

finish(usage : LLM::Usage, cost : Float64 | Nil = nil) : Nil

Always the last line, carrying the answer reassembled from every text block, so a consumer can just take the final object.

Source
handle(event : Events::Event) : Nil
Source
prompt_io

Where an approval prompt should write. In JSON mode this must not be stdout, or the prompt would land in the middle of the JSONL stream.

Source