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 fail-closed fallback achievement result (no LLM required).
Goal completion is a control-plane decision: a host may stop an
unbounded engineering loop as soon as GoalAchieved is emitted. Plain
answer text such as “done” (or even “not complete”) is not sufficient
evidence for that decision. If the structured evaluator is unavailable,
keep every success criterion open and let the host retry in a later
iteration.
Sourcepub async fn pre_analyze(
llm: &Arc<dyn LlmClient>,
prompt: &str,
) -> Result<PreAnalysis>
pub async fn pre_analyze( llm: &Arc<dyn LlmClient>, prompt: &str, ) -> Result<PreAnalysis>
Perform pre-analysis in a single LLM call: intent classification, goal extraction, execution plan, and input optimization. Falls back to heuristics on failure.
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more