pub struct ExecutionStep {
pub step_number: usize,
pub timestamp: DateTime<Utc>,
pub tool: String,
pub action: String,
pub parameters_json: String,
pub result: Option<ExecutionResult>,
pub latency_ms: u64,
pub tokens_used: Option<usize>,
pub metadata: HashMap<String, String>,
}Expand description
A single execution step within an episode.
Represents one discrete action or operation performed during task execution.
§Postcard Compatibility
The parameters_json field stores JSON as a String to ensure postcard
deserialization works correctly. Postcard cannot deserialize serde_json::Value
directly. Use parameters() and set_parameters() for JSON value access.
Fields§
§step_number: usizeStep number in sequence (1-indexed)
timestamp: DateTime<Utc>When this step was executed
tool: StringTool or function used
action: StringDescription of action taken
parameters_json: StringInput parameters as JSON string (postcard-compatible)
Use parameters() to get as serde_json::Value
result: Option<ExecutionResult>Result of execution
latency_ms: u64Execution time in milliseconds
tokens_used: Option<usize>Number of tokens used (if applicable)
metadata: HashMap<String, String>Additional metadata
Implementations§
Source§impl ExecutionStep
impl ExecutionStep
Sourcepub fn new(step_number: usize, tool: String, action: String) -> Self
pub fn new(step_number: usize, tool: String, action: String) -> Self
Create a new execution step with default values.
Sourcepub fn parameters(&self) -> Value
pub fn parameters(&self) -> Value
Get parameters as serde_json::Value.
Returns Value::Null if JSON parsing fails.
Sourcepub fn set_parameters(&mut self, value: Value)
pub fn set_parameters(&mut self, value: Value)
Set parameters from serde_json::Value.
Converts to JSON string. If serialization fails, sets to empty object.
Sourcepub fn with_parameters(self, params: Value) -> Self
pub fn with_parameters(self, params: Value) -> Self
Create step with parameters value (builder pattern).
Sourcepub fn is_success(&self) -> bool
pub fn is_success(&self) -> bool
Check if this step was successful.
Trait Implementations§
Source§impl Clone for ExecutionStep
impl Clone for ExecutionStep
Source§fn clone(&self) -> ExecutionStep
fn clone(&self) -> ExecutionStep
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ExecutionStep
impl Debug for ExecutionStep
Source§impl<'de> Deserialize<'de> for ExecutionStep
impl<'de> Deserialize<'de> for ExecutionStep
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>,
Source§impl PartialEq for ExecutionStep
impl PartialEq for ExecutionStep
Source§impl Serialize for ExecutionStep
impl Serialize for ExecutionStep
impl StructuralPartialEq for ExecutionStep
Auto Trait Implementations§
impl Freeze for ExecutionStep
impl RefUnwindSafe for ExecutionStep
impl Send for ExecutionStep
impl Sync for ExecutionStep
impl Unpin for ExecutionStep
impl UnsafeUnpin for ExecutionStep
impl UnwindSafe for ExecutionStep
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<T> DeserializeOwnedAlias for Twhere
T: DeserializeOwned,
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>
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>
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 moreimpl<T> Scalar for T
impl<T> Scalar for T
impl<T> SendAlias for T
impl<T> SendAlias for T
impl<T> SendSyncUnwindSafe for Twhere
T: Send + Sync + UnwindSafe + ?Sized,
Source§impl<T> Serialize for T
impl<T> Serialize for T
fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<Ok, Error>
impl<T> SerializeAlias for Twhere
T: Serialize,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.