pub struct ModelResponse {
pub model: String,
pub content: Vec<Content>,
pub stop_reason: StopReason,
pub usage: Usage,
pub served_by: Option<String>,
pub rejected: Vec<RejectedAttempt>,
}Fields§
§model: StringModel name as reported by the provider.
content: Vec<Content>§stop_reason: StopReason§usage: Usage§served_by: Option<String>Model::id of the model that served this response, when a
composite model (e.g. FallbackModel) chose among several.
rejected: Vec<RejectedAttempt>Earlier answers in this call that were discarded as unusable. Their tokens were still paid for and count toward budgets.
Implementations§
Source§impl ModelResponse
impl ModelResponse
Sourcepub fn total_usage(&self) -> Usage
pub fn total_usage(&self) -> Usage
Tokens for this response plus any rejected attempts.
Trait Implementations§
Source§impl Clone for ModelResponse
impl Clone for ModelResponse
Source§impl Debug for ModelResponse
impl Debug for ModelResponse
Source§impl Default for ModelResponse
impl Default for ModelResponse
Source§impl<'de> Deserialize<'de> for ModelResponse
impl<'de> Deserialize<'de> for ModelResponse
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 ModelResponse
impl PartialEq for ModelResponse
Source§impl Serialize for ModelResponse
impl Serialize for ModelResponse
impl StructuralPartialEq for ModelResponse
Auto Trait Implementations§
impl Freeze for ModelResponse
impl RefUnwindSafe for ModelResponse
impl Send for ModelResponse
impl Sync for ModelResponse
impl Unpin for ModelResponse
impl UnsafeUnpin for ModelResponse
impl UnwindSafe for ModelResponse
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