pub struct Agent { /* private fields */ }Expand description
A multi-turn agentic loop that drives an LLM provider, executes tool calls, and emits hook events at each lifecycle point.
Implementations§
Source§impl Agent
impl Agent
Sourcepub fn new(provider: Arc<dyn Provider>, config: AgentConfig) -> Self
pub fn new(provider: Arc<dyn Provider>, config: AgentConfig) -> Self
Create a new agent with the given provider and configuration.
Sourcepub fn with_defaults(provider: Arc<dyn Provider>) -> Self
pub fn with_defaults(provider: Arc<dyn Provider>) -> Self
Create a new agent with the locked default configuration.
Trait Implementations§
Source§impl Component for Agent
impl Component for Agent
Source§fn start<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = AppResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn start<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = AppResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Start the component. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for Agent
impl !UnwindSafe for Agent
impl Freeze for Agent
impl Send for Agent
impl Sync for Agent
impl Unpin for Agent
impl UnsafeUnpin 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