Skip to main content

Agent

Trait Agent 

Source
pub trait Agent: Send + Sync {
    // Required method
    fn run(&self, task: Task) -> impl Stream<Item = AgentRunResult> + Send + '_;
}
Expand description

Trait for an agent under evaluation.

Implementors run a Task in their configured execution environment and stream the observed AgentMessages.

§Example

let mut messages = agent.run(Task::new("write hello.txt"));

Required Methods§

Source

fn run(&self, task: Task) -> impl Stream<Item = AgentRunResult> + Send + '_

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§