Skip to main content

usage_record

Function usage_record 

Source
pub fn usage_record(
    input: Option<u64>,
    output: Option<u64>,
    total: Option<u64>,
) -> Vec<(Expr, Expr)>
Expand description

The canonical token-usage entries built from optional counts, in the fixed order input-tokens, output-tokens, total-tokens. Each present count becomes one number_field; absent counts are skipped. The caller decides how to wrap the result, because providers differ: some emit a usage map even when empty, others omit usage entirely when no counts are present.