pub struct RunResult {
pub output: String,
pub structured: Option<Value>,
pub schema: Option<SchemaHandle>,
pub steps: Vec<AgentStep>,
pub tokens: Option<TokenUsage>,
pub duration: Duration,
pub iterations: usize,
}Expand description
Result of an agent execution run
Fields§
§output: StringFinal output from the agent
structured: Option<Value>Optional structured payload returned alongside the final answer
schema: Option<SchemaHandle>Schema metadata associated with the structured payload
steps: Vec<AgentStep>All reasoning steps taken during execution
tokens: Option<TokenUsage>Total tokens used (if available from API)
duration: DurationTotal execution duration
iterations: usizeNumber of iterations used
Implementations§
Source§impl RunResult
impl RunResult
Sourcepub fn new(
output: String,
structured: Option<Value>,
schema: Option<SchemaHandle>,
steps: Vec<AgentStep>,
tokens: Option<TokenUsage>,
duration: Duration,
iterations: usize,
) -> Self
pub fn new( output: String, structured: Option<Value>, schema: Option<SchemaHandle>, steps: Vec<AgentStep>, tokens: Option<TokenUsage>, duration: Duration, iterations: usize, ) -> Self
Create a new RunResult
Sourcepub fn structured(&self) -> Option<&Value>
pub fn structured(&self) -> Option<&Value>
Access the structured payload, if present.
Sourcepub fn schema(&self) -> Option<&SchemaHandle>
pub fn schema(&self) -> Option<&SchemaHandle>
Access the schema handle associated with the structured payload.
Sourcepub fn has_structured(&self) -> bool
pub fn has_structured(&self) -> bool
Check whether a structured payload is available.
Sourcepub fn deserialize_structured<T>(&self) -> AgentResult<T>where
T: CompletionSchema,
pub fn deserialize_structured<T>(&self) -> AgentResult<T>where
T: CompletionSchema,
Deserialize the structured payload into the requested type using the stored schema metadata.
Sourcepub fn action_count(&self) -> usize
pub fn action_count(&self) -> usize
Get count of actions (tool calls) executed
Sourcepub fn observation_count(&self) -> usize
pub fn observation_count(&self) -> usize
Get count of observations (tool results)
Sourcepub fn is_success(&self) -> bool
pub fn is_success(&self) -> bool
Check if execution completed successfully (has final answer)
Trait Implementations§
Source§impl<'de> Deserialize<'de> for RunResult
impl<'de> Deserialize<'de> for RunResult
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 RunResult
impl RefUnwindSafe for RunResult
impl Send for RunResult
impl Sync for RunResult
impl Unpin for RunResult
impl UnsafeUnpin for RunResult
impl UnwindSafe for RunResult
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