pub struct TokenEstimatorConfig {
pub int_factor: f32,
pub float_factor: f32,
pub string_factor: f32,
pub hex_factor: f32,
pub bytes_per_token: f32,
pub separator_tokens: usize,
pub newline_tokens: usize,
pub header_tokens: usize,
}Expand description
Token estimation configuration
Fields§
§int_factor: f32Multiplier for integer values
float_factor: f32Multiplier for float values
string_factor: f32Multiplier for string values
hex_factor: f32Multiplier for binary (hex) values
bytes_per_token: f32Bytes per token (approximate)
separator_tokens: usizeSeparator cost in tokens
newline_tokens: usizeNewline cost in tokens
header_tokens: usizeHeader overhead tokens
Implementations§
Trait Implementations§
Source§impl Clone for TokenEstimatorConfig
impl Clone for TokenEstimatorConfig
Source§fn clone(&self) -> TokenEstimatorConfig
fn clone(&self) -> TokenEstimatorConfig
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 TokenEstimatorConfig
impl Debug for TokenEstimatorConfig
Auto Trait Implementations§
impl Freeze for TokenEstimatorConfig
impl RefUnwindSafe for TokenEstimatorConfig
impl Send for TokenEstimatorConfig
impl Sync for TokenEstimatorConfig
impl Unpin for TokenEstimatorConfig
impl UnwindSafe for TokenEstimatorConfig
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