pub struct SessionConfig {
pub max_sessions: Option<usize>,
pub max_turns_per_session: Option<usize>,
pub max_message_tokens: Option<usize>,
}Fields§
§max_sessions: Option<usize>最大 session 数量,超过时 LRU 逐出整个 session(从内存卸载,数据保留) None = 不限制
max_turns_per_session: Option<usize>单个 session 最大保留轮数,超过从前面截掉最旧轮次 None = 不限制
max_message_tokens: Option<usize>单条消息 token 上限(安全阀),超过不存入 session 历史 阈值应设很高(如 100k),只拦异常情况 None = 不限制
Trait Implementations§
Source§impl Clone for SessionConfig
impl Clone for SessionConfig
Source§fn clone(&self) -> SessionConfig
fn clone(&self) -> SessionConfig
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 Debug for SessionConfig
impl Debug for SessionConfig
Auto Trait Implementations§
impl Freeze for SessionConfig
impl RefUnwindSafe for SessionConfig
impl Send for SessionConfig
impl Sync for SessionConfig
impl Unpin for SessionConfig
impl UnsafeUnpin for SessionConfig
impl UnwindSafe for SessionConfig
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