#[non_exhaustive]pub struct GraphReport { /* private fields */ }Expand description
The result of one finished graph run: the last node’s output, the whole state, usage, steps and the run id. Read it through the getters.
Implementations§
Source§impl GraphReport
impl GraphReport
Sourcepub fn output(&self) -> &Value
pub fn output(&self) -> &Value
Returns the last node’s output, the answer of the graph.
A string for text nodes.
The same value run returns.
Sourcepub fn state(&self) -> &Map<String, Value>
pub fn state(&self) -> &Map<String, Value>
Returns the final state: input plus one entry per node id.
Each value is that node’s output.
Read only.
Sourcepub fn usage(&self) -> Usage
pub fn usage(&self) -> Usage
Returns the tokens and cost every agent node used, summed. Cost is in millionths of a US dollar. Tool nodes add nothing.
Sourcepub fn steps(&self) -> u64
pub fn steps(&self) -> u64
Returns how many graph steps the run took.
Bounded by the workflow’s max_steps.
At least one.
Sourcepub fn run_id(&self) -> RunId
pub fn run_id(&self) -> RunId
Returns the id of the run, for resume and logs.
Unique per run.
Stable across checkpoints.
Sourcepub fn trace_path(&self) -> Option<&Path>
pub fn trace_path(&self) -> Option<&Path>
Returns the trace file this run was written to.
None when tracing is off or goes to a custom sink.
Every run of one built graph shares the file.