pub struct Trajectory {
pub agent_name: String,
pub task_id: String,
pub total_duration_ms: u64,
pub steps: Vec<TrajectoryStep>,
pub success: bool,
pub metadata: Value,
}Expand description
Complete trajectory for a task execution
Fields§
§agent_name: StringAgent that executed the task
task_id: StringTask identifier
total_duration_ms: u64Total execution time in milliseconds
steps: Vec<TrajectoryStep>All steps in the execution
success: boolWhether the task succeeded
metadata: ValueAdditional metadata
Implementations§
Source§impl Trajectory
impl Trajectory
Sourcepub fn tool_call_count(&self) -> usize
pub fn tool_call_count(&self) -> usize
Get count of tool calls in trajectory
Sourcepub fn llm_call_count(&self) -> usize
pub fn llm_call_count(&self) -> usize
Get count of LLM calls in trajectory
Sourcepub fn failed_step_count(&self) -> usize
pub fn failed_step_count(&self) -> usize
Get count of failed steps
Sourcepub fn total_tokens(&self) -> (u32, u32)
pub fn total_tokens(&self) -> (u32, u32)
Get total tokens used (if tracked)
Sourcepub fn tools_used(&self) -> Vec<String>
pub fn tools_used(&self) -> Vec<String>
Get all tool names used
Sourcepub fn steps_by_type(&self, step_type: StepType) -> Vec<&TrajectoryStep>
pub fn steps_by_type(&self, step_type: StepType) -> Vec<&TrajectoryStep>
Get steps by type
Sourcepub fn to_json_pretty(&self) -> Result<String, Error>
pub fn to_json_pretty(&self) -> Result<String, Error>
Convert to pretty JSON
Sourcepub fn summary(&self) -> TrajectorySummary
pub fn summary(&self) -> TrajectorySummary
Get summary statistics
Trait Implementations§
Source§impl Clone for Trajectory
impl Clone for Trajectory
Source§fn clone(&self) -> Trajectory
fn clone(&self) -> Trajectory
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for Trajectory
impl Debug for Trajectory
Source§impl<'de> Deserialize<'de> for Trajectory
impl<'de> Deserialize<'de> for Trajectory
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more