Skip to main content

RunOutcome

Struct RunOutcome 

Source
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: RunState

Full state, ready to persist, resume, or continue with RunState::with_user_message.

Implementations§

Source§

impl RunOutcome

Source

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.

Source

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).

Source

pub fn unmet(&self) -> &[String]

Requirements a stop hook reported as unmet when the run stopped.

Source

pub fn usage(&self) -> Usage

Usage of the whole session.

Source

pub fn run_usage(&self) -> Usage

Usage of this run only.

Source

pub fn receipts(&self) -> &[Receipt]

Source

pub fn turns(&self) -> u32

Source

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).

Source

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).

Trait Implementations§

Source§

impl Clone for RunOutcome

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for RunOutcome

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for RunOutcome

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for RunOutcome

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for RunOutcome

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for RunOutcome

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.