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§
Sourcefn 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 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
Sourcefn can_handle(&self, node: &SRBNNode) -> bool
fn can_handle(&self, node: &SRBNNode) -> bool
Check if this agent can handle the given node
Sourcefn build_prompt(&self, node: &SRBNNode, ctx: &AgentContext) -> String
fn build_prompt(&self, node: &SRBNNode, ctx: &AgentContext) -> String
Build the prompt for this agent (for logging)