pub struct Agent { /* private fields */ }Expand description
Drives the assistant ↔ tool loop. One Agent is reusable across many
run calls; the conversation lives in the caller-owned messages Vec.
Implementations§
Source§impl Agent
impl Agent
pub fn new( llm: Arc<dyn LlmClient>, tools: ToolRegistry, options: AgentOptions, ) -> Self
Sourcepub fn with_approver(self, approver: Arc<dyn ToolApprover>) -> Self
pub fn with_approver(self, approver: Arc<dyn ToolApprover>) -> Self
Install a tool approver. Defaults to AllowAllApprover — replace
with a real implementation (e.g. the CLI’s console prompter) to gate
sensitive tools.
pub fn options(&self) -> &AgentOptions
pub fn options_mut(&mut self) -> &mut AgentOptions
pub fn tools(&self) -> &ToolRegistry
Auto Trait Implementations§
impl Freeze for Agent
impl !RefUnwindSafe for Agent
impl Send for Agent
impl Sync for Agent
impl Unpin for Agent
impl UnsafeUnpin for Agent
impl !UnwindSafe for Agent
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