pub struct GenerateOutput {
pub content: Vec<Content>,
pub tool_uses: Vec<ToolUse>,
pub turn_end_reason: TurnEndReason,
pub usage: Option<TokenUsage>,
}Fields§
§content: Vec<Content>§tool_uses: Vec<ToolUse>§turn_end_reason: TurnEndReason§usage: Option<TokenUsage>Last usage observed on the stream, if the provider reported any.
Implementations§
Source§impl GenerateOutput
impl GenerateOutput
Sourcepub async fn from_generation(
stream: impl Stream<Item = GenerationEvent>,
) -> Result<Self, GenerateError>
pub async fn from_generation( stream: impl Stream<Item = GenerationEvent>, ) -> Result<Self, GenerateError>
Consume and validate one attempt without applying retry policy.
Failures return their cause; consume GenerationEvent directly when
the transient classification or provider retry delay is needed.
pub async fn from_stream( stream: impl Stream<Item = Result<MessagePart, GenerateError>>, ) -> Result<Self, GenerateError>
Trait Implementations§
Source§impl Clone for GenerateOutput
impl Clone for GenerateOutput
Source§fn clone(&self) -> GenerateOutput
fn clone(&self) -> GenerateOutput
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 moreAuto Trait Implementations§
impl Freeze for GenerateOutput
impl RefUnwindSafe for GenerateOutput
impl Send for GenerateOutput
impl Sync for GenerateOutput
impl Unpin for GenerateOutput
impl UnsafeUnpin for GenerateOutput
impl UnwindSafe for GenerateOutput
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