pub struct Agent { /* private fields */ }Implementations§
Source§impl Agent
impl Agent
pub fn new( config: AgentConfig, provider: Box<dyn Provider>, memory: Box<dyn MemoryStore>, tools: Vec<Box<dyn Tool>>, ) -> Self
pub fn with_audit(self, audit: Box<dyn AuditSink>) -> Self
pub fn with_hooks(self, hooks: Box<dyn HookSink>) -> Self
pub fn with_metrics(self, metrics: Box<dyn MetricsSink>) -> Self
pub async fn respond( &self, user: UserMessage, ctx: &ToolContext, ) -> Result<AssistantMessage, AgentError>
Sourcepub async fn respond_streaming(
&self,
user: UserMessage,
ctx: &ToolContext,
sink: StreamSink,
) -> Result<AssistantMessage, AgentError>
pub async fn respond_streaming( &self, user: UserMessage, ctx: &ToolContext, sink: StreamSink, ) -> Result<AssistantMessage, AgentError>
Streaming variant of respond(). Sends incremental StreamChunks through
sink as tokens arrive from the provider. Returns the final accumulated
AssistantMessage once the stream completes.
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