#[non_exhaustive]pub struct RunCapture {
pub run_id: String,
pub status: RunStatus,
pub error: Option<String>,
pub error_type: Option<String>,
pub outputs: Map<String, Value>,
pub answer: String,
pub usage: Usage,
pub latency_ms: u64,
pub events: Vec<Event>,
}Expand description
Everything recorded about one run.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.run_id: String§status: RunStatus§error: Option<String>§error_type: Option<String>§outputs: Map<String, Value>The workflow outputs (end node outputs).
answer: StringThe streamed answer text (answer nodes), empty when there is none.
usage: Usage§latency_ms: u64Wall time of the run in milliseconds, measured by the harness.
events: Vec<Event>The run’s events, without node_chunk events (their text is in answer
and the node outputs).
Implementations§
Source§impl RunCapture
impl RunCapture
Sourcepub fn from_events(events: Vec<Event>, answer: String, latency_ms: u64) -> Self
pub fn from_events(events: Vec<Event>, answer: String, latency_ms: u64) -> Self
Build a capture from a run’s events (chunk events are dropped).
Sourcepub fn output(&self) -> Json
pub fn output(&self) -> Json
The main output assertions check by default: the answer text when the workflow streamed one, else the single output value, else the outputs object.
Sourcepub fn subject_root(&self, vars: &Map<String, Json>) -> Json
pub fn subject_root(&self, vars: &Map<String, Json>) -> Json
The object paths are resolved against: output, answer, outputs,
usage, latency_ms, status, error, plus vars from the test.
Sourcepub fn tool_calls(&self) -> Vec<ToolCallRecord>
pub fn tool_calls(&self) -> Vec<ToolCallRecord>
Every tool call in the order the agents announced them (tool_call
progress events), enriched with the provider and tool name from the
agent’s tool_calls output.
Sourcepub fn agent_steps(&self) -> usize
pub fn agent_steps(&self) -> usize
Number of agent steps (model turns: agent_step progress events).
Sourcepub fn node_executions(&self) -> usize
pub fn node_executions(&self) -> usize
Number of node executions that finished (succeeded or failed).
Sourcepub fn retrieval_hits(&self) -> Vec<RetrievalHit>
pub fn retrieval_hits(&self) -> Vec<RetrievalHit>
Hits of every knowledge-retrieval node, in rank order (nodes in the
order they finished).