pub struct LlmPlanner;Expand description
LLM-powered planner that generates plans, extracts goals, and evaluates achievement
Implementations§
Source§impl LlmPlanner
impl LlmPlanner
Sourcepub async fn create_plan(
llm: &Arc<dyn LlmClient>,
prompt: &str,
) -> Result<ExecutionPlan>
pub async fn create_plan( llm: &Arc<dyn LlmClient>, prompt: &str, ) -> Result<ExecutionPlan>
Generate an execution plan from a prompt using LLM
Sourcepub async fn extract_goal(
llm: &Arc<dyn LlmClient>,
prompt: &str,
) -> Result<AgentGoal>
pub async fn extract_goal( llm: &Arc<dyn LlmClient>, prompt: &str, ) -> Result<AgentGoal>
Extract a goal with success criteria from a prompt using LLM
Sourcepub async fn check_achievement(
llm: &Arc<dyn LlmClient>,
goal: &AgentGoal,
current_state: &str,
) -> Result<AchievementResult>
pub async fn check_achievement( llm: &Arc<dyn LlmClient>, goal: &AgentGoal, current_state: &str, ) -> Result<AchievementResult>
Evaluate whether a goal has been achieved given current state
Sourcepub fn fallback_plan(prompt: &str) -> ExecutionPlan
pub fn fallback_plan(prompt: &str) -> ExecutionPlan
Create a fallback plan using heuristic logic (no LLM required)
Sourcepub fn fallback_goal(prompt: &str) -> AgentGoal
pub fn fallback_goal(prompt: &str) -> AgentGoal
Create a fallback goal using heuristic logic (no LLM required)
Sourcepub fn fallback_check_achievement(
goal: &AgentGoal,
current_state: &str,
) -> AchievementResult
pub fn fallback_check_achievement( goal: &AgentGoal, current_state: &str, ) -> AchievementResult
Create a fallback achievement result using heuristic logic (no LLM required)
Trait Implementations§
Source§impl Planner for LlmPlanner
impl Planner for LlmPlanner
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,
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,
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,
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
Auto Trait Implementations§
impl Freeze for LlmPlanner
impl RefUnwindSafe for LlmPlanner
impl Send for LlmPlanner
impl Sync for LlmPlanner
impl Unpin for LlmPlanner
impl UnsafeUnpin for LlmPlanner
impl UnwindSafe for LlmPlanner
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more