pub struct Runner;
Expand description
Minimal runner scaffold to orchestrate a single agent call.
Implementations§
Source§impl Runner
impl Runner
pub async fn run<A: Agent>( agent: &A, ctx: &AgentContext, ) -> Result<(), AgentError>
Sourcepub async fn run_tools_collect(
registry: &ToolRegistry,
ctx: &AgentContext,
input: &str,
behavior: &ToolUseBehavior,
) -> Result<(Vec<(String, String)>, Option<String>), AgentError>
pub async fn run_tools_collect( registry: &ToolRegistry, ctx: &AgentContext, input: &str, behavior: &ToolUseBehavior, ) -> Result<(Vec<(String, String)>, Option<String>), AgentError>
Execute tools and collect outputs; may short-circuit based on behavior.
Sourcepub async fn run_agent_with_model<M: Model + ?Sized>(
model: &M,
ctx: &AgentContext,
instructions: Option<&str>,
input: &str,
behavior: ToolUseBehavior,
) -> Result<RunResult, AgentError>
pub async fn run_agent_with_model<M: Model + ?Sized>( model: &M, ctx: &AgentContext, instructions: Option<&str>, input: &str, behavior: ToolUseBehavior, ) -> Result<RunResult, AgentError>
Minimal agent loop: try tools first (optional), then call the model with instructions.
Auto Trait Implementations§
impl Freeze for Runner
impl RefUnwindSafe for Runner
impl Send for Runner
impl Sync for Runner
impl Unpin for Runner
impl UnwindSafe for Runner
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