Observed token counts and their measurement coverage.
Input counts retain their provider's meaning, recorded in input_token_basis.
Missing cache measurements are nil; measured zero remains zero. When
complete? is false, numeric counts are observed subtotals. Completeness
covers represented contributions, not additional unfinished provider work.
Summary
Types
Provider-verbatim usage objects; their keys and values are not interpreted here.
Functions
Adds contributions once; missing measurements make their total incomplete.
Validates a closed atom-keyed projection or an existing usage struct.
The known empty accumulation identity, distinct from an absent usage report.
Types
@type input_token_basis() :: :uncached | :inclusive | :unknown | :none
@type raw() :: [map()]
Provider-verbatim usage objects; their keys and values are not interpreted here.
@type t() :: %ReqManagedAgents.Usage{ cache_creation_input_tokens: non_neg_integer() | nil, cache_read_input_tokens: non_neg_integer() | nil, complete?: boolean(), input_token_basis: input_token_basis(), input_tokens: non_neg_integer(), output_tokens: non_neg_integer(), raw: raw() }
Functions
Adds contributions once; missing measurements make their total incomplete.
Validates a closed atom-keyed projection or an existing usage struct.
Missing or nil input/output becomes zero with incomplete coverage; other invalid input/output returns a tagged error. Invalid optional cache counts become nil. An explicit false coverage flag cannot be upgraded.
@spec zero() :: t()
The known empty accumulation identity, distinct from an absent usage report.