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§
Sourcefn description(&self) -> &str
fn description(&self) -> &str
Human-readable description.
Sourcefn run(
&self,
input: Value,
) -> BoxFuture<'_, Result<AgentEventStream, AgentError>>
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§
Sourcefn sub_agents(&self) -> Vec<String>
fn sub_agents(&self) -> Vec<String>
Returns the names of agents this node may spawn as sub-agents.