pub struct ExactTokenConfig {
pub model: TokenizerModel,
pub cache_size: usize,
pub cache_ttl_secs: u64,
pub fallback_on_error: bool,
pub max_cache_text_len: usize,
}Expand description
Configuration for exact token counter
Fields§
§model: TokenizerModelPrimary tokenizer model
cache_size: usizeLRU cache size (number of entries)
cache_ttl_secs: u64Cache TTL in seconds (0 = no expiry)
fallback_on_error: boolWhether to fall back to heuristic on error
max_cache_text_len: usizeMaximum text length for caching (longer texts aren’t cached)
Implementations§
Trait Implementations§
Source§impl Clone for ExactTokenConfig
impl Clone for ExactTokenConfig
Source§fn clone(&self) -> ExactTokenConfig
fn clone(&self) -> ExactTokenConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ExactTokenConfig
impl Debug for ExactTokenConfig
Auto Trait Implementations§
impl Freeze for ExactTokenConfig
impl RefUnwindSafe for ExactTokenConfig
impl Send for ExactTokenConfig
impl Sync for ExactTokenConfig
impl Unpin for ExactTokenConfig
impl UnwindSafe for ExactTokenConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more