pub struct AgentConfig {Show 20 fields
pub providers: Vec<ModelProvider>,
pub active_index: usize,
pub system_prompt: Option<String>,
pub max_history_messages: usize,
pub max_context_tokens: usize,
pub theme: ThemeName,
pub tools_enabled: bool,
pub max_tool_rounds: usize,
pub style: Option<String>,
pub tool_confirm_timeout: u64,
pub disabled_tools: Vec<String>,
pub deferred_tools: Vec<String>,
pub disabled_skills: Vec<String>,
pub disabled_commands: Vec<String>,
pub disabled_hooks: Vec<String>,
pub compact: CompactConfig,
pub auto_restore_session: bool,
pub flat_bubble: bool,
pub thinking_style: ThinkingStyle,
pub welcome_quote: bool,
}Expand description
Agent 配置
Fields§
§providers: Vec<ModelProvider>模型提供方列表
active_index: usize当前选中的 provider 索引
system_prompt: Option<String>系统提示词(可选)
max_history_messages: usize发送给 API 的历史消息数量限制(默认 20 条,避免 token 消耗过大)
max_context_tokens: usize上下文 token 预算(优先级选择时的 token 上限,默认 100K)
theme: ThemeName主题名称(dark / light / midnight)
tools_enabled: bool是否启用工具调用(默认关闭)
max_tool_rounds: usize工具调用最大轮数(默认 10,防止无限循环)
style: Option<String>回复风格(可选)
tool_confirm_timeout: u64工具确认超时秒数(0 表示不超时,需手动确认;>0 则超时后自动执行)
disabled_tools: Vec<String>被禁用的工具名称列表(tools_enabled=true 时,此列表中的工具不会发送给 LLM)
deferred_tools: Vec<String>延迟加载的工具名称列表(需要 LoadTool 加载后才可用)
disabled_skills: Vec<String>被禁用的 skill 名称列表(列表中的 skill 不会包含在系统提示词中)
disabled_commands: Vec<String>被禁用的 command 名称列表
disabled_hooks: Vec<String>被禁用的 hook 标识列表(格式:source:unique_id,如 user:my_hook、session:0)
compact: CompactConfigContext compact 配置
auto_restore_session: bool启动时是否自动恢复最近的 session
flat_bubble: bool气泡背景色与主背景色一致(扁平效果)
thinking_style: ThinkingStyle思考指示器动画风格
welcome_quote: bool欢迎界面是否显示诗句
Trait Implementations§
Source§impl Clone for AgentConfig
impl Clone for AgentConfig
Source§fn clone(&self) -> AgentConfig
fn clone(&self) -> AgentConfig
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 AgentConfig
impl Debug for AgentConfig
Source§impl Default for AgentConfig
impl Default for AgentConfig
Source§impl<'de> Deserialize<'de> for AgentConfig
impl<'de> Deserialize<'de> for AgentConfig
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 AgentConfig
impl RefUnwindSafe for AgentConfig
impl Send for AgentConfig
impl Sync for AgentConfig
impl Unpin for AgentConfig
impl UnsafeUnpin for AgentConfig
impl UnwindSafe for AgentConfig
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>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<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>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> 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)
Convert
&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)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.