pub struct CommonOpts {
pub model: String,
pub context_window: usize,
pub max_tokens: usize,
pub auto_compress: bool,
pub scratch: Option<String>,
}Expand description
请求级公共配置,内嵌于各后端的 Opts 类型。
ContextBackend::Opts 通过 AsRef<CommonOpts> 约束,确保后端 Opts 提供这些字段。
每次请求由调用方显式构造,不提供 Default。
Fields§
§model: String模型标识(如 "deepseek-v4-pro"、"glm-4-flash")。
context_window: usize模型上下文窗口大小(token 数),用于自动压缩检测。
max_tokens: usize最大输出 token 数。
auto_compress: bool上下文溢出时是否自动压缩。false 时溢出返回错误。
scratch: Option<String>每轮刷新的临时元数据,发送时作为 system 消息拼接到对话末尾,不存储。
Trait Implementations§
Source§impl Clone for CommonOpts
impl Clone for CommonOpts
Source§fn clone(&self) -> CommonOpts
fn clone(&self) -> CommonOpts
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 CommonOpts
impl Debug for CommonOpts
impl Eq for CommonOpts
Source§impl PartialEq for CommonOpts
impl PartialEq for CommonOpts
Source§fn eq(&self, other: &CommonOpts) -> bool
fn eq(&self, other: &CommonOpts) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for CommonOpts
Auto Trait Implementations§
impl Freeze for CommonOpts
impl RefUnwindSafe for CommonOpts
impl Send for CommonOpts
impl Sync for CommonOpts
impl Unpin for CommonOpts
impl UnsafeUnpin for CommonOpts
impl UnwindSafe for CommonOpts
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<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<A, T> DynMessage<A> for T
impl<A, T> DynMessage<A> for T
Source§fn handle_dyn<'a>(
self: Box<T>,
state: &'a mut A,
actor_ref: ActorRef<A>,
tx: Option<Sender<Result<Box<dyn Any + Send>, SendError<Box<dyn Any + Send>, Box<dyn Any + Send>>>>>,
stop: &'a mut bool,
) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn ReplyError>>> + Send + 'a>>
fn handle_dyn<'a>( self: Box<T>, state: &'a mut A, actor_ref: ActorRef<A>, tx: Option<Sender<Result<Box<dyn Any + Send>, SendError<Box<dyn Any + Send>, Box<dyn Any + Send>>>>>, stop: &'a mut bool, ) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn ReplyError>>> + Send + 'a>>
Handles the dyn message with the provided actor state, ref, and reply sender.