pub struct AgentOutcome {
pub response: ModelResponse,
pub transcript: Vec<Message>,
pub turns: u32,
pub tool_calls: u32,
pub delegations: u32,
pub usage: Usage,
}Expand description
Successful terminal state of an agent run.
Fields§
§response: ModelResponseFinal model response.
transcript: Vec<Message>Complete canonical transcript, including tool calls and results.
turns: u32Model turns performed by this agent.
tool_calls: u32Tool calls attempted by this agent.
delegations: u32Successful direct child-agent delegations performed by this agent.
usage: UsageShared run-tree usage snapshot at completion.
Implementations§
Source§impl AgentOutcome
impl AgentOutcome
Sourcepub fn into_text(self) -> String
pub fn into_text(self) -> String
Consumes the outcome and returns only model-visible terminal text.
Use this only when the transcript, usage, counters, warnings, and provider-specific response data are no longer needed.
Sourcepub fn into_structured<T>(
self,
) -> Result<StructuredAgentOutcome<T>, StructuredOutputError>where
T: DeserializeOwned,
pub fn into_structured<T>(
self,
) -> Result<StructuredAgentOutcome<T>, StructuredOutputError>where
T: DeserializeOwned,
Locally validates and decodes the final model response while preserving the complete canonical outcome.
§Errors
Returns StructuredOutputError when the response is missing textual
output, contains a refusal, or does not deserialize as T.
Trait Implementations§
Source§impl Clone for AgentOutcome
impl Clone for AgentOutcome
Source§fn clone(&self) -> AgentOutcome
fn clone(&self) -> AgentOutcome
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AgentOutcome
impl Debug for AgentOutcome
Source§impl<'de> Deserialize<'de> for AgentOutcome
impl<'de> Deserialize<'de> for AgentOutcome
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
Source§impl PartialEq for AgentOutcome
impl PartialEq for AgentOutcome
Source§impl Serialize for AgentOutcome
impl Serialize for AgentOutcome
impl StructuralPartialEq for AgentOutcome
Auto Trait Implementations§
impl Freeze for AgentOutcome
impl RefUnwindSafe for AgentOutcome
impl Send for AgentOutcome
impl Sync for AgentOutcome
impl Unpin for AgentOutcome
impl UnsafeUnpin for AgentOutcome
impl UnwindSafe for AgentOutcome
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