Skip to main content

ChildAgent

Trait ChildAgent 

Source
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§

Source

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".

Implementors§

Source§

impl<M, H, C, Schema> ChildAgent for Agent<M, H, C, Schema>
where Schema: HandoffSchema, M: LanguageModel + 'static, C: LanguageModel + 'static, H: Hooks,