view_run() renders an agent_run (or anything as_agent_run() accepts)
into a single self-contained HTML file: a header (kind, run id, short
manifest hash, agents, creation time, total calls and tokens) followed by one
table per grain (utterance, event, call, tool). Event rows carry an HTML
anchor keyed by their span_id, and transcript and call cells that name a
span link to it, so a reader can trace an utterance to the model call, span
event, and tool output that produced it.
Usage
view_run(run, output = NULL, open = interactive())Arguments
- run
An Agent or any object accepted by
as_agent_run().- output
Path to write. Defaults to a temp file with extension
.html. A missing parent directory is created.- open
If
TRUE(the default in an interactive session) the file is opened withutils::browseURL()after writing.
Value
The output path, invisibly, with class agent_inspector_path (its
print method reports where the file was written).
Details
The inspector is a read-only view: it visualizes the substrate already captured by
the run and derives nothing. It prefers htmltools when that package is
installed; otherwise it builds the same content by hand with no optional
dependencies. If no HTML page can be produced at all, it writes a structured
text summary so the call still yields a file.
Examples
if (FALSE) { # \dontrun{
a <- agent("Ada", LLMR::llm_config("groq", "openai/gpt-oss-20b"))
a$chat("Tell me something true.")
view_run(a)
} # }