pub enum TokenScaling {
Double,
Linear {
step: u32,
},
Fixed(Vec<u32>),
}Expand description
How successive recovery attempts grow max_output_tokens.
Variants§
Double
Double per attempt: 4096 → 8192 → 16384 → … Worst case
2^max_attempts × the starting cap. Default for callers
that prefer a small ladder with big steps.
Linear
Add a fixed step per attempt: 4096 → 4096+step → 4096+2·step. Predictable cost ladder; better when the model usually only needs a little more room.
Fixed(Vec<u32>)
Explicit progression: caps[0] for the first retry, caps[1]
for the second, etc. Lets callers express “try 8k then 16k
then give up” without computing scales.
Trait Implementations§
Source§impl Clone for TokenScaling
impl Clone for TokenScaling
Source§fn clone(&self) -> TokenScaling
fn clone(&self) -> TokenScaling
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 moreAuto Trait Implementations§
impl Freeze for TokenScaling
impl RefUnwindSafe for TokenScaling
impl Send for TokenScaling
impl Sync for TokenScaling
impl Unpin for TokenScaling
impl UnsafeUnpin for TokenScaling
impl UnwindSafe for TokenScaling
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