pub fn estimate_tokens(
messages: &[Message],
options: &CountTokensOptions,
) -> u64Expand description
The default Model::count_tokens estimate: text length / 4 and JSON length / 2, in UTF-16 code
units, with only the latest user message’s injected blocks.
Providers with a native counting API fall back to it on failure.