Skip to main content

Planner

Trait Planner 

Source
pub trait Planner: Send + Sync {
    // Required methods
    fn create_plan<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        llm: &'life1 Arc<dyn LlmClient>,
        prompt: &'life2 str,
    ) -> Pin<Box<dyn Future<Output = Result<ExecutionPlan>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn extract_goal<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        llm: &'life1 Arc<dyn LlmClient>,
        prompt: &'life2 str,
    ) -> Pin<Box<dyn Future<Output = Result<AgentGoal>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn check_achievement<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        llm: &'life1 Arc<dyn LlmClient>,
        goal: &'life2 AgentGoal,
        current_state: &'life3 str,
    ) -> Pin<Box<dyn Future<Output = Result<AchievementResult>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait;
}
Expand description

Trait for planning providers

Abstracts plan generation, goal extraction, and achievement evaluation. Allows different implementations (LLM-based, heuristic, test mocks).

Required Methods§

Source

fn create_plan<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, llm: &'life1 Arc<dyn LlmClient>, prompt: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<ExecutionPlan>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Generate an execution plan from a prompt

Source

fn extract_goal<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, llm: &'life1 Arc<dyn LlmClient>, prompt: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<AgentGoal>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Extract a goal with success criteria from a prompt

Source

fn check_achievement<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, llm: &'life1 Arc<dyn LlmClient>, goal: &'life2 AgentGoal, current_state: &'life3 str, ) -> Pin<Box<dyn Future<Output = Result<AchievementResult>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Evaluate whether a goal has been achieved given current state

Implementors§