pub struct AgentRunner<M> { /* private fields */ }Expand description
Runnable agent implementation.
Implementations§
Source§impl<M> AgentRunner<M>where
M: Memory,
impl<M> AgentRunner<M>where
M: Memory,
Sourcepub fn new(
llm: Arc<dyn LlmProvider>,
memory: M,
tools: ToolRegistry,
system_prompt: Option<String>,
config: AgentConfig,
) -> Self
pub fn new( llm: Arc<dyn LlmProvider>, memory: M, tools: ToolRegistry, system_prompt: Option<String>, config: AgentConfig, ) -> Self
Creates a new agent runner.
Sourcepub async fn run(&mut self, input: &str) -> Result<AgentOutput>
pub async fn run(&mut self, input: &str) -> Result<AgentOutput>
Runs the agent to completion.
Sourcepub async fn stream_run(
&mut self,
input: &str,
) -> Result<BoxStream<'_, Result<AgentEvent>>>
pub async fn stream_run( &mut self, input: &str, ) -> Result<BoxStream<'_, Result<AgentEvent>>>
Runs the agent as a stream of events.
Trait Implementations§
Source§impl<M> Agent for AgentRunner<M>where
M: Memory,
impl<M> Agent for AgentRunner<M>where
M: Memory,
Auto Trait Implementations§
impl<M> Freeze for AgentRunner<M>where
M: Freeze,
impl<M> !RefUnwindSafe for AgentRunner<M>
impl<M> Send for AgentRunner<M>where
M: Send,
impl<M> Sync for AgentRunner<M>where
M: Sync,
impl<M> Unpin for AgentRunner<M>where
M: Unpin,
impl<M> UnsafeUnpin for AgentRunner<M>where
M: UnsafeUnpin,
impl<M> !UnwindSafe for AgentRunner<M>
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