as_agent_run() turns any high-level result into an agent_run: a single
object that exposes a run at five levels through one tidy accessor,
tibble::as_tibble(run, level = c("utterance","event","call","tool","state")),
and that backs agent_manifest(), archive_agent_study(),
diagnostics(), and report().
Usage
as_agent_run(x, ...)
# S3 method for class 'agent_run'
as_tibble(x, ..., level = c("utterance", "event", "call", "tool", "state"))Arguments
- x
An Agent; a conversation, debate, focus group, interview, or deliberation; an
agent_pipeline_run; anagent_fanout_result; anagent_experiment; or anagent_run.- ...
Unused.
tibble::as_tibble()also accepts the level name as its second, unnamed argument.- level
The grain to return:
"utterance"(analysis grain),"event"(every span),"call"(storedLLMR::llm_response_record()rows),"tool"(tool invocations with arg/result hashes; a call that was not run because its arguments did not parse or its reply was cut off has status"refused"), or"state"(each participating agent's memory at run end).
Value
An object of class agent_run; tibble::as_tibble() returns the
requested level as a tibble.
Details
Provenance is captured during every model call, so
converting costs nothing during the run; the views are built on demand. For a
bare Agent, the result is a live view of the agent's session so far. A
completed conversation, preset, or pipeline records its agents' tools,
generation parameters, and memory as they were when it closed, so reusing or
changing those agents later does not change its manifest or state view.
Workflow runs are not converted; they keep their own checkpoint and replay
record (see run_workflow()).
The call level holds the stored LLMR::llm_response_record() rows. A tool
exchange takes several model rounds but stores one record, for its final
response, and memory compactions and embedding operations appear only as
events. Records written under different LLMR versions are bound by column
name; a column absent from some records is filled with missing values of
the type the other records use. A call event whose record could not be
built (status "unrecorded") makes the call level an error that names the
event, while the other levels remain available.
