pub struct Response {
pub items: Vec<Item>,
pub finish_reason: FinishReason,
pub usage: Usage,
}Expand description
The result of processing a Request: output items plus the
finish reason and token usage.
Fields§
§items: Vec<Item>The output items, in order.
finish_reason: FinishReasonWhy generation stopped.
usage: UsageToken usage for the request.
Implementations§
Source§impl Response
impl Response
Sourcepub fn text(&self) -> String
pub fn text(&self) -> String
The concatenated text of all textual output items.
Handles both plain Item::Text items and
Item::Message items (whose text content parts are
concatenated); other item kinds are ignored. A convenience for chat
responses, where the output is typically a single assistant message.
Trait Implementations§
impl StructuralPartialEq for Response
Auto Trait Implementations§
impl Freeze for Response
impl RefUnwindSafe for Response
impl Send for Response
impl Sync for Response
impl Unpin for Response
impl UnsafeUnpin for Response
impl UnwindSafe for Response
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