pub struct CharDivTokenEstimator;Expand description
Default heuristic: 1 token ≈ 4 bytes.
Trait Implementations§
Source§impl TokenEstimator for CharDivTokenEstimator
impl TokenEstimator for CharDivTokenEstimator
Source§fn count_tokens(&self, text: &str) -> usize
fn count_tokens(&self, text: &str) -> usize
Return an approximate token count for
text.Auto Trait Implementations§
impl Freeze for CharDivTokenEstimator
impl RefUnwindSafe for CharDivTokenEstimator
impl Send for CharDivTokenEstimator
impl Sync for CharDivTokenEstimator
impl Unpin for CharDivTokenEstimator
impl UnsafeUnpin for CharDivTokenEstimator
impl UnwindSafe for CharDivTokenEstimator
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more