Skip to main content

RunCapture

Struct RunCapture 

Source
#[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
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional 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: String

The streamed answer text (answer nodes), empty when there is none.

§usage: Usage§latency_ms: u64

Wall 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

Source

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).

Source

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.

Source

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.

Source

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.

Source

pub fn agent_steps(&self) -> usize

Number of agent steps (model turns: agent_step progress events).

Source

pub fn node_executions(&self) -> usize

Number of node executions that finished (succeeded or failed).

Source

pub fn retrieval_hits(&self) -> Vec<RetrievalHit>

Hits of every knowledge-retrieval node, in rank order (nodes in the order they finished).

Trait Implementations§

Source§

impl Clone for RunCapture

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for RunCapture

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for RunCapture

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.