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: PayloadThe assistant message, in the canonical content-block shape.
calls: u64How 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.