#[non_exhaustive]pub struct ClassifyReply {
pub batch_id: String,
pub model: String,
pub items: Vec<ItemResult>,
pub usage: Usage,
pub cost_usd: Option<Number>,
}Expand description
The classify.run reply.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.batch_id: String§model: String§items: Vec<ItemResult>One per request item, in request order.
usage: UsageSummed over answered items; a count no item reported is absent.
cost_usd: Option<Number>The batch’s cumulative cost in USD, the same on every reply to the batch, a replay included. Absent only when the model is unpriced.
Implementations§
Source§impl ClassifyReply
impl ClassifyReply
Sourcepub fn new(
batch_id: impl Into<String>,
model: impl Into<String>,
items: Vec<ItemResult>,
) -> Self
pub fn new( batch_id: impl Into<String>, model: impl Into<String>, items: Vec<ItemResult>, ) -> Self
A reply whose usage is summed from items.
pub fn with_usage(self, usage: Usage) -> Self
pub fn with_cost_usd(self, cost_usd: Number) -> Self
Trait Implementations§
Source§impl Clone for ClassifyReply
impl Clone for ClassifyReply
Source§impl Debug for ClassifyReply
impl Debug for ClassifyReply
Source§impl<'de> Deserialize<'de> for ClassifyReply
impl<'de> Deserialize<'de> for ClassifyReply
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 ClassifyReply
impl PartialEq for ClassifyReply
Source§impl Serialize for ClassifyReply
impl Serialize for ClassifyReply
impl StructuralPartialEq for ClassifyReply
Auto Trait Implementations§
impl Freeze for ClassifyReply
impl RefUnwindSafe for ClassifyReply
impl Send for ClassifyReply
impl Sync for ClassifyReply
impl Unpin for ClassifyReply
impl UnsafeUnpin for ClassifyReply
impl UnwindSafe for ClassifyReply
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