pub struct Trajectory {
pub steps: Vec<Step>,
pub model_calls: usize,
pub tool_calls: usize,
pub input_tokens: u32,
pub output_tokens: u32,
pub ended: bool,
}Expand description
A run flattened into ordered Steps plus totals.
Fields§
§steps: Vec<Step>§model_calls: usize§tool_calls: usize§input_tokens: u32§output_tokens: u32§ended: boolAn End event was seen. A log without one was cut off.
Implementations§
Source§impl Trajectory
impl Trajectory
Sourcepub fn from_events(events: &[SessionEvent]) -> Self
pub fn from_events(events: &[SessionEvent]) -> Self
Build the normalized view from recorded events.
A PreTool starts a tool step already marked failed (“no result”); the
matching PostTool (same call_id) overwrites that. Doing it in this
order means a run that died mid-call is visible as a failure instead of
the call silently vanishing.
Sourcepub fn tool_sequence(&self) -> Vec<String>
pub fn tool_sequence(&self) -> Vec<String>
Tool names in call order: the structure of the run.
Sourcepub fn compare_to_golden(&self, golden: &Trajectory) -> GoldenDiff
pub fn compare_to_golden(&self, golden: &Trajectory) -> GoldenDiff
Compare this run’s tool sequence with a known good one.
Trait Implementations§
Source§impl Clone for Trajectory
impl Clone for Trajectory
Source§impl Debug for Trajectory
impl Debug for Trajectory
Auto Trait Implementations§
impl Forget for Trajectory
impl Freeze for Trajectory
impl RefUnwindSafe for Trajectory
impl Send for Trajectory
impl Sync for Trajectory
impl Unpin for Trajectory
impl UnsafeUnpin for Trajectory
impl UnwindSafe for Trajectory
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more