pub trait ChildAgent: Send {
// Required method
fn run(
&mut self,
prompt: &str,
events: &ChildEvents,
cancel: CancelSignal,
) -> impl Future<Output = RunOutcome> + Send;
}Expand description
An agent that can run as a child of another.
Implemented for Agent; an embedder implements it for an agent that
lives elsewhere, such as an external session behind a protocol. The child
reports its events to events, each stamped with its own path, and stops
when cancel fires.
Required Methods§
Sourcefn run(
&mut self,
prompt: &str,
events: &ChildEvents,
cancel: CancelSignal,
) -> impl Future<Output = RunOutcome> + Send
fn run( &mut self, prompt: &str, events: &ChildEvents, cancel: CancelSignal, ) -> impl Future<Output = RunOutcome> + Send
Runs the child on prompt until it ends, and says how it ended.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".