Skip to main content

AgentNode

Trait AgentNode 

Source
pub trait AgentNode: Send + Sync {
    // Required methods
    fn name(&self) -> &str;
    fn description(&self) -> &str;
    fn run(
        &self,
        input: Value,
    ) -> BoxFuture<'_, Result<AgentEventStream, AgentError>>;

    // Provided method
    fn sub_agents(&self) -> Vec<String> { ... }
}
Expand description

A runnable agent that produces a stream of events.

Required Methods§

Source

fn name(&self) -> &str

Unique agent name (stable identifier for routing and logging).

Source

fn description(&self) -> &str

Human-readable description.

Source

fn run( &self, input: Value, ) -> BoxFuture<'_, Result<AgentEventStream, AgentError>>

Run the agent, returning a stream of events.

input is the initial user message or continuation prompt. The stream ends with a TurnComplete or Error event.

Provided Methods§

Source

fn sub_agents(&self) -> Vec<String>

Returns the names of agents this node may spawn as sub-agents.

Implementors§