pub struct OnTokenBudget {
pub max_bytes: usize,
}Expand description
Trigger consolidation when the buffer’s total text length
(summed UTF-8 byte length of every ContentPart::Text) exceeds
max_bytes. Approximates a token-budget gate without needing a
tokenizer in the SDK.
Fields§
§max_bytes: usizeMaximum cumulative text bytes before consolidation fires.
Implementations§
Trait Implementations§
Source§impl Clone for OnTokenBudget
impl Clone for OnTokenBudget
Source§fn clone(&self) -> OnTokenBudget
fn clone(&self) -> OnTokenBudget
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl ConsolidationPolicy for OnTokenBudget
impl ConsolidationPolicy for OnTokenBudget
Source§fn should_consolidate(&self, ctx: &ConsolidationContext<'_>) -> bool
fn should_consolidate(&self, ctx: &ConsolidationContext<'_>) -> bool
Return
true when the buffer is ready for consolidation.Source§impl Debug for OnTokenBudget
impl Debug for OnTokenBudget
Source§impl Hash for OnTokenBudget
impl Hash for OnTokenBudget
Source§impl PartialEq for OnTokenBudget
impl PartialEq for OnTokenBudget
Source§fn eq(&self, other: &OnTokenBudget) -> bool
fn eq(&self, other: &OnTokenBudget) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for OnTokenBudget
impl Eq for OnTokenBudget
impl StructuralPartialEq for OnTokenBudget
Auto Trait Implementations§
impl Freeze for OnTokenBudget
impl RefUnwindSafe for OnTokenBudget
impl Send for OnTokenBudget
impl Sync for OnTokenBudget
impl Unpin for OnTokenBudget
impl UnsafeUnpin for OnTokenBudget
impl UnwindSafe for OnTokenBudget
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.