Agent

Trait Agent 

Source
pub trait Agent: Send + Sync {
    // Required methods
    fn process<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        node: &'life1 SRBNNode,
        ctx: &'life2 AgentContext,
    ) -> Pin<Box<dyn Future<Output = Result<AgentMessage>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn name(&self) -> &str;
    fn can_handle(&self, node: &SRBNNode) -> bool;
    fn model(&self) -> &str;
    fn build_prompt(&self, node: &SRBNNode, ctx: &AgentContext) -> String;
}
Expand description

The Agent trait defines the interface for SRBN agents.

Each agent role (Architect, Actuator, Verifier, Speculator) implements this trait to provide specialized behavior.

Required Methods§

Source

fn process<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, node: &'life1 SRBNNode, ctx: &'life2 AgentContext, ) -> Pin<Box<dyn Future<Output = Result<AgentMessage>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Process a task and return a message

Source

fn name(&self) -> &str

Get the agent’s display name

Source

fn can_handle(&self, node: &SRBNNode) -> bool

Check if this agent can handle the given node

Source

fn model(&self) -> &str

Get the model name used by this agent (for logging)

Source

fn build_prompt(&self, node: &SRBNNode, ctx: &AgentContext) -> String

Build the prompt for this agent (for logging)

Implementors§