pub struct GenerateTextResult<O> {
pub steps: Vec<StepResult>,
pub total_usage: Usage,
pub output: O,
}Expand description
Result of a completed generation loop.
Fields§
§steps: Vec<StepResult>All steps in order (at least one).
total_usage: UsageUsage summed over all steps.
output: OThe structured output (() when none was requested).
Implementations§
Source§impl<O> GenerateTextResult<O>
impl<O> GenerateTextResult<O>
Sourcepub fn last_step(&self) -> &StepResult
pub fn last_step(&self) -> &StepResult
Sourcepub fn reasoning_text(&self) -> Option<String>
pub fn reasoning_text(&self) -> Option<String>
Reasoning text of the final step.
Sourcepub fn finish_reason(&self) -> &FinishReason
pub fn finish_reason(&self) -> &FinishReason
Finish reason of the final step.
Sourcepub fn provider_metadata(&self) -> Option<&ProviderMetadata>
pub fn provider_metadata(&self) -> Option<&ProviderMetadata>
Provider metadata of the final step.
Sourcepub fn response_messages(&self) -> Vec<Message>
pub fn response_messages(&self) -> Vec<Message>
Messages of all steps, ready to append to the conversation history.
Sourcepub fn map_output<P>(self, f: impl FnOnce(O) -> P) -> GenerateTextResult<P>
pub fn map_output<P>(self, f: impl FnOnce(O) -> P) -> GenerateTextResult<P>
Maps the output.
Trait Implementations§
Source§impl<O: Clone> Clone for GenerateTextResult<O>
impl<O: Clone> Clone for GenerateTextResult<O>
Source§fn clone(&self) -> GenerateTextResult<O>
fn clone(&self) -> GenerateTextResult<O>
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<O: Debug> Debug for GenerateTextResult<O>
impl<O: Debug> Debug for GenerateTextResult<O>
Source§impl<O: PartialEq> PartialEq for GenerateTextResult<O>
impl<O: PartialEq> PartialEq for GenerateTextResult<O>
impl<O: PartialEq> StructuralPartialEq for GenerateTextResult<O>
Auto Trait Implementations§
impl<O> Freeze for GenerateTextResult<O>where
O: Freeze,
impl<O> RefUnwindSafe for GenerateTextResult<O>where
O: RefUnwindSafe,
impl<O> Send for GenerateTextResult<O>where
O: Send,
impl<O> Sync for GenerateTextResult<O>where
O: Sync,
impl<O> Unpin for GenerateTextResult<O>where
O: Unpin,
impl<O> UnsafeUnpin for GenerateTextResult<O>where
O: UnsafeUnpin,
impl<O> UnwindSafe for GenerateTextResult<O>where
O: 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
Mutably borrows from an owned value. Read more