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).
Trait Implementations§
Source§impl Clone for RunOutcome
impl Clone for RunOutcome
Source§fn clone(&self) -> RunOutcome
fn clone(&self) -> RunOutcome
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 RunOutcome
impl Debug for RunOutcome
Source§impl<'de> Deserialize<'de> for RunOutcome
impl<'de> Deserialize<'de> for RunOutcome
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<RunOutcome, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<RunOutcome, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for RunOutcome
impl PartialEq for RunOutcome
Source§impl Serialize for RunOutcome
impl Serialize for RunOutcome
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for RunOutcome
Auto Trait Implementations§
impl Forget for RunOutcome
impl Freeze for RunOutcomewhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<Value>: Freeze,
*const LeafNode<String, Value> is !null: Freeze,
PhantomData<(Owned, LeafOrInternal)>: Freeze,
PhantomData<Box<(String, Value)>>: Freeze,
PhantomData<EffectKey>: Freeze,
PhantomData<String>: Freeze,
*const ApprovalCard is !null: Freeze,
PhantomData<ApprovalCard>: Freeze,
PhantomData<Message>: Freeze,
PhantomData<Receipt>: Freeze,
PhantomData<ToolCall>: Freeze,
*const RunState is !null: Freeze,
PhantomData<RunState>: Freeze,
PhantomData<usize>: Freeze,
PhantomData<Observation>: Freeze,
*const ArcInner<Mutex<Vec<EffectKey>>> is !null: Freeze,
PhantomData<ArcInner<Mutex<Vec<EffectKey>>>>: Freeze,
*const LeafNode<String, SetValZST> is !null: Freeze,
PhantomData<Box<(String, SetValZST)>>: Freeze,
PhantomData<ToolLoad>: Freeze,
impl Move for RunOutcome
impl RefUnwindSafe for RunOutcome
impl Send for RunOutcome
impl Sync for RunOutcome
impl Unpin for RunOutcome
impl UnsafeUnpin for RunOutcomewhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<Value>: UnsafeUnpin,
*const LeafNode<String, Value> is !null: UnsafeUnpin,
PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin,
PhantomData<Box<(String, Value)>>: UnsafeUnpin,
PhantomData<EffectKey>: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
*const ApprovalCard is !null: UnsafeUnpin,
PhantomData<ApprovalCard>: UnsafeUnpin,
PhantomData<Message>: UnsafeUnpin,
PhantomData<Receipt>: UnsafeUnpin,
PhantomData<ToolCall>: UnsafeUnpin,
*const RunState is !null: UnsafeUnpin,
PhantomData<RunState>: UnsafeUnpin,
PhantomData<usize>: UnsafeUnpin,
PhantomData<Observation>: UnsafeUnpin,
*const ArcInner<Mutex<Vec<EffectKey>>> is !null: UnsafeUnpin,
PhantomData<ArcInner<Mutex<Vec<EffectKey>>>>: UnsafeUnpin,
*const LeafNode<String, SetValZST> is !null: UnsafeUnpin,
PhantomData<Box<(String, SetValZST)>>: UnsafeUnpin,
PhantomData<ToolLoad>: UnsafeUnpin,
impl UnwindSafe for RunOutcomewhere
RawVecInner: UnwindSafe,
BTreeMap<String, Value>: UnwindSafe,
BoxRaw<ApprovalCard>: UnwindSafe,
BoxRaw<RunState>: UnwindSafe,
Arc<Mutex<Vec<EffectKey>>>: UnwindSafe,
BTreeMap<String, SetValZST>: UnwindSafe,
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>,
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 more