pub enum RealtimeTruncation {
Auto,
Disabled,
RetentionRatio(RetentionRatioTruncation),
}Available on crate feature
realtime only.Expand description
The truncation strategy to use for the session.
Variants§
Auto
auto is the default truncation strategy.
Disabled
disabled will disable truncation and emit errors when the conversation exceeds the input
token limit.
RetentionRatio(RetentionRatioTruncation)
Retain a fraction of the conversation tokens when the conversation exceeds the input token limit. This allows you to amortize truncations across multiple turns, which can help improve cached token usage.
Trait Implementations§
Source§impl Clone for RealtimeTruncation
impl Clone for RealtimeTruncation
Source§fn clone(&self) -> RealtimeTruncation
fn clone(&self) -> RealtimeTruncation
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 RealtimeTruncation
impl Debug for RealtimeTruncation
Source§impl<'de> Deserialize<'de> for RealtimeTruncation
impl<'de> Deserialize<'de> for RealtimeTruncation
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for RealtimeTruncation
impl RefUnwindSafe for RealtimeTruncation
impl Send for RealtimeTruncation
impl Sync for RealtimeTruncation
impl Unpin for RealtimeTruncation
impl UnwindSafe for RealtimeTruncation
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