pub struct ConversationConfig {
pub compression_enabled: bool,
pub preserve_last_n_turns: usize,
pub compression_threshold_tokens: usize,
pub min_score_to_preserve: f64,
pub drop_score_below: f64,
}Expand description
Opt-in conversation-history compression settings (#1123).
The proxy leaves conversation history byte-for-byte unchanged unless
compression_enabled is true and the configured token threshold is met.
Each older message is scored; it is kept verbatim at or above
min_score_to_preserve, replaced by a stub below drop_score_below, and
summarized to one line in between. Neither a summary nor a stub keeps a
recoverable copy, so the proxy leaves history untouched under protection.
Fields§
§compression_enabled: boolEnable message-level compression in the proxy. Default: false.
preserve_last_n_turns: usizeNumber of most recent messages always kept verbatim.
compression_threshold_tokens: usizeMinimum estimated message-array size before compression starts.
min_score_to_preserve: f64Minimum score for verbatim preservation.
drop_score_below: f64Messages scoring below this value are replaced by a one-line stub.
Trait Implementations§
Source§impl Clone for ConversationConfig
impl Clone for ConversationConfig
Source§impl Debug for ConversationConfig
impl Debug for ConversationConfig
Source§impl Default for ConversationConfig
impl Default for ConversationConfig
Source§impl<'de> Deserialize<'de> for ConversationConfigwhere
ConversationConfig: Default,
impl<'de> Deserialize<'de> for ConversationConfigwhere
ConversationConfig: Default,
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>,
Source§impl PartialEq for ConversationConfig
impl PartialEq for ConversationConfig
Source§impl Serialize for ConversationConfig
impl Serialize for ConversationConfig
impl StructuralPartialEq for ConversationConfig
Auto Trait Implementations§
impl Forget for ConversationConfig
impl Freeze for ConversationConfig
impl Move for ConversationConfig
impl RefUnwindSafe for ConversationConfig
impl Send for ConversationConfig
impl Sync for ConversationConfig
impl Unpin for ConversationConfig
impl UnsafeUnpin for ConversationConfig
impl UnwindSafe for ConversationConfig
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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> ⓘ
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> ⓘ
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