pub struct TurnUsage {Show 14 fields
pub turn: u32,
pub input: u64,
pub cached: u64,
pub output: u64,
pub thinking: u64,
pub prompt_messages: usize,
pub appended: bool,
pub new_chars: usize,
pub fold_budget: Option<usize>,
pub model_ms: u64,
pub tools_ms: u64,
pub first_data_ms: Option<u64>,
pub max_gap_ms: u64,
pub failed_attempts: Vec<FailedAttempt>,
}Expand description
One call of the main loop: what it cost, and how its prompt related to the previous call’s.
appended means the prompt was the previous one plus new_chars of new messages, the only
case where a prefix cache can serve everything but the new part. Fresh input far above
new_chars / 4 on an appended call is a cache miss; on a rewritten one (a fold) it is expected.
Fields§
§turn: u32§input: u64§cached: u64§output: u64§thinking: u64§prompt_messages: usize§appended: bool§new_chars: usize§fold_budget: Option<usize>The fold budget in force for this call, for strategies that fold.
model_ms: u64Wall time of this turn’s model call, including any provider retries and their waits.
tools_ms: u64Wall time spent executing this turn’s tool calls (0 for a turn with none).
first_data_ms: Option<u64>Milliseconds to the first data of the model call that ended this turn’s calling
(None: the provider does not stream, or no data arrived).
max_gap_ms: u64Longest silence, in milliseconds, in that same call (0 when the provider does not stream).
failed_attempts: Vec<FailedAttempt>One entry per attempt of this turn’s model call that failed and was retried, in order.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for TurnUsage
impl<'de> Deserialize<'de> for TurnUsage
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>,
impl Eq for TurnUsage
impl StructuralPartialEq for TurnUsage
Auto Trait Implementations§
impl Forget for TurnUsage
impl Freeze for TurnUsage
impl Move for TurnUsage
impl RefUnwindSafe for TurnUsage
impl Send for TurnUsagewhere
RawVecInner: Send,
impl Sync for TurnUsagewhere
RawVecInner: Sync,
impl Unpin for TurnUsage
impl UnsafeUnpin for TurnUsage
impl UnwindSafe for TurnUsagewhere
RawVecInner: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.