pub struct ExecutionTrace {
pub id: Uuid,
pub protocol_id: String,
pub protocol_version: String,
pub input: Value,
pub steps: Vec<StepTrace>,
pub output: Option<Value>,
pub status: ExecutionStatus,
pub timing: TimingInfo,
pub tokens: TokenUsage,
pub confidence: f64,
pub metadata: TraceMetadata,
}Expand description
A complete execution trace
Fields§
§id: UuidUnique trace identifier
protocol_id: StringProtocol that was executed
protocol_version: StringProtocol version
input: ValueInput provided to the protocol
steps: Vec<StepTrace>Step-by-step execution record
output: Option<Value>Final output (if completed)
status: ExecutionStatusOverall execution status
timing: TimingInfoTiming information
tokens: TokenUsageTotal token usage
confidence: f64Overall confidence
metadata: TraceMetadataExecution metadata
Implementations§
Source§impl ExecutionTrace
impl ExecutionTrace
Sourcepub fn new(
protocol_id: impl Into<String>,
protocol_version: impl Into<String>,
) -> Self
pub fn new( protocol_id: impl Into<String>, protocol_version: impl Into<String>, ) -> Self
Create a new execution trace
Sourcepub fn with_input(self, input: Value) -> Self
pub fn with_input(self, input: Value) -> Self
Set input
Sourcepub fn completed_steps(&self) -> usize
pub fn completed_steps(&self) -> usize
Get completed step count
Sourcepub fn average_confidence(&self) -> f64
pub fn average_confidence(&self) -> f64
Get average step confidence
Sourcepub fn to_json_compact(&self) -> Result<String, Error>
pub fn to_json_compact(&self) -> Result<String, Error>
Export trace to compact JSON
Trait Implementations§
Source§impl Clone for ExecutionTrace
impl Clone for ExecutionTrace
Source§fn clone(&self) -> ExecutionTrace
fn clone(&self) -> ExecutionTrace
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 ExecutionTrace
impl Debug for ExecutionTrace
Source§impl Default for ExecutionTrace
impl Default for ExecutionTrace
Source§fn default() -> ExecutionTrace
fn default() -> ExecutionTrace
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ExecutionTrace
impl<'de> Deserialize<'de> for ExecutionTrace
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 ExecutionTrace
impl RefUnwindSafe for ExecutionTrace
impl Send for ExecutionTrace
impl Sync for ExecutionTrace
impl Unpin for ExecutionTrace
impl UnwindSafe for ExecutionTrace
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