pub struct Runner<O: Serialize + Send + Sync + 'static = ()> { /* private fields */ }Expand description
Drives the agent execution loop.
The runner is stateless between runs; all per-run state is held in the
channel and local variables inside run.
Implementations§
Source§impl<O: Serialize + Send + Sync + 'static> Runner<O>
impl<O: Serialize + Send + Sync + 'static> Runner<O>
Sourcepub async fn set_model(&self, model: impl Into<String>)
pub async fn set_model(&self, model: impl Into<String>)
Dynamically switch the model for subsequent turns, preserving conversation history.
Sourcepub async fn stop_graceful(&self)
pub async fn stop_graceful(&self)
Send a graceful stop signal. The runner will finish any in-flight
tool call, then emit TurnComplete { reason: Stopped }.
Sourcepub async fn stop_force(&self)
pub async fn stop_force(&self)
Send a force stop signal. The runner cancels immediately and emits
TurnComplete { reason: Aborted }.
Sourcepub async fn run(
&self,
input: Value,
config: RunnerConfig,
) -> Result<Receiver<AgentEvent>, AgentError>
pub async fn run( &self, input: Value, config: RunnerConfig, ) -> Result<Receiver<AgentEvent>, AgentError>
Trait Implementations§
Auto Trait Implementations§
impl<O = ()> !Freeze for Runner<O>
impl<O = ()> !RefUnwindSafe for Runner<O>
impl<O> Send for Runner<O>
impl<O> Sync for Runner<O>
impl<O> Unpin for Runner<O>
impl<O> UnsafeUnpin for Runner<O>
impl<O = ()> !UnwindSafe for Runner<O>
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