pub enum MeasurementSource {
Native {
provider: String,
},
LocalExact {
tokenizer: String,
},
Postflight,
Heuristic,
}Expand description
Where a token count came from — never just a bare u32, so a caller can tell “the provider’s
own count API said so” apart from “we guessed.” The provenance remains part of the reserved
contract, but no runtime currently persists or consumes this fact.
Variants§
Native
The provider’s own token-counting endpoint answered (e.g. Anthropic
messages/count_tokens, OpenAI Responses token counting, Gemini countTokens).
LocalExact
A real BPE tokenizer ran locally, but against a vocabulary that may not be the target
provider’s own (e.g. cl100k standing in for a non-OpenAI vendor) — see
FallbackEstimator (spc_011-C-01) for the concrete counter this describes.
Postflight
The provider’s own postflight usage for this exact request, fed back after execution (spc_024-06). The authority a replay reuses — never a preflight guess.
Heuristic
No tokenizer ran at all; this is a coarse guess with a generous safety margin.
Trait Implementations§
Source§impl Clone for MeasurementSource
impl Clone for MeasurementSource
Source§fn clone(&self) -> MeasurementSource
fn clone(&self) -> MeasurementSource
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more