Skip to main content

estimate_token_count

Function estimate_token_count 

Source
pub fn estimate_token_count(text: &str) -> usize
Expand description

Estimates the number of tokens in text using default options.

ยงExamples

use tokenx_rs::estimate_token_count;

assert_eq!(estimate_token_count(""), 0);
assert!(estimate_token_count("Hello, world!") > 0);