pub struct AgentExecutor { /* private fields */ }Expand description
Agent 执行器
负责执行 Agent 的决策循环:Plan → Act → Observe
Implementations§
Source§impl AgentExecutor
impl AgentExecutor
Sourcepub fn new(agent: Arc<dyn BaseAgent>, tools: Vec<Arc<dyn BaseTool>>) -> Self
pub fn new(agent: Arc<dyn BaseAgent>, tools: Vec<Arc<dyn BaseTool>>) -> Self
创建新的 AgentExecutor
Sourcepub fn with_max_iterations(self, max_iterations: usize) -> Self
pub fn with_max_iterations(self, max_iterations: usize) -> Self
设置最大迭代次数
Sourcepub fn with_verbose(self, verbose: bool) -> Self
pub fn with_verbose(self, verbose: bool) -> Self
设置详细输出
Sourcepub fn with_memory(self, memory: Arc<Mutex<dyn BaseMemory>>) -> Self
pub fn with_memory(self, memory: Arc<Mutex<dyn BaseMemory>>) -> Self
设置记忆
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AgentExecutor
impl !RefUnwindSafe for AgentExecutor
impl Send for AgentExecutor
impl Sync for AgentExecutor
impl Unpin for AgentExecutor
impl UnsafeUnpin for AgentExecutor
impl !UnwindSafe for AgentExecutor
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