pub struct RunOutcome {
pub status: RunStatus,
pub final_text: Option<String>,
pub state: RunState,
}Expand description
The typed result of crate::Agent::run or crate::Agent::resume.
Fields§
§status: RunStatus§final_text: Option<String>Text of the last assistant message, when the run completed.
state: RunStateFull state, ready to persist, resume, or continue with
RunState::with_user_message.
Implementations§
Source§impl RunOutcome
impl RunOutcome
Sourcepub fn is_completed(&self) -> bool
pub fn is_completed(&self) -> bool
The run stopped because the model answered and every stop hook let
it stop. That is not the same as the work being done: see
RunOutcome::is_succeeded.
Sourcepub fn is_succeeded(&self) -> bool
pub fn is_succeeded(&self) -> bool
The run’s objective was met, as far as the kernel and its hooks can
tell: it completed with no unmet requirement and nothing the owner
declined, or a tool finished it as Succeeded (the kernel already
reports a finish in a run with declines as Partial).
Sourcepub fn unmet(&self) -> &[String]
pub fn unmet(&self) -> &[String]
Requirements a stop hook reported as unmet when the run stopped.
pub fn receipts(&self) -> &[Receipt]
pub fn turns(&self) -> u32
Sourcepub fn elapsed(&self) -> Duration
pub fn elapsed(&self) -> Duration
How long the run took, summed across resumes, on the runtime’s clock (Tokio’s, so a test with paused time measures paused time).
Sourcepub fn tool_results(&self) -> Vec<CallResult<'_>>
pub fn tool_results(&self) -> Vec<CallResult<'_>>
Each tool call of this run with the result the model was given, in
call order: the receipt (tool, arguments, status, details) and the
text of the tool message that answered it. A sub-agent’s answer
reaches its parent this way. text is None when no message
answers the call any more (a hook edited the transcript).