Skip to main content

ModelReturned

Struct ModelReturned 

Source
pub struct ModelReturned {
    pub message: Payload,
    pub calls: u64,
    pub usage: Option<ModelUsage>,
    pub stop: Option<StopReason>,
    pub billed_usd_micros: Option<UsdMicros>,
    pub first_at: Option<TimeMs>,
    pub first_us: Option<u64>,
    pub took_us: Option<u64>,
}
Expand description

model_returned: the reply, the size of the wave it asked for, and what the provider said it cost.

Every field but message and calls is absent when the provider did not report it, which is not the same fact as reporting zero.

Fields§

§message: Payload

The assistant message, in the canonical content-block shape.

§calls: u64

How many tool calls the reply asked for.

§usage: Option<ModelUsage>

Four token counts in the one meaning ModelUsage states, the dialect that reported them, and the meaning’s version v.

§stop: Option<StopReason>

Why the provider stopped, when it said.

§billed_usd_micros: Option<UsdMicros>

What the provider itself billed, when it returns a figure; the city’s own price list is what fills the gap when it does not.

§first_at: Option<TimeMs>

When the reply’s first non-empty prose or reasoning reached the city, read from the turn’s clock (crates/kernel/spec/Event/Record.lean §8-75). A moment, not a duration: the time to first content is this minus the model_called line’s t. Absent when the reply came through a door that reports nothing before it settles, when it streamed only tool calls, and on every line written before the key existed - none of which is a zero.

§first_us: Option<u64>

Whole microseconds from the moment the attempt that returned went out to its first non-empty prose or reasoning, on the turn’s monotonic clock (crates/kernel/spec/Event/Record.lean D20). Absent exactly where first_at is.

§took_us: Option<u64>

Whole microseconds from the moment the attempt that returned went out to the moment its reply was whole, on the same clock. Absent on every line written before the key existed.

Trait Implementations§

Source§

impl Clone for ModelReturned

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ModelReturned

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for ModelReturned

Source§

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 ModelReturned

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for ModelReturned

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for ModelReturned

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.