pub struct PlanGenerator;Expand description
Plan generator for creating execution plans from LLM responses
Implementations§
Source§impl PlanGenerator
impl PlanGenerator
Sourcepub fn create_planning_prompt(goal: &str, tools: &[ToolSchema]) -> String
pub fn create_planning_prompt(goal: &str, tools: &[ToolSchema]) -> String
Generate a planning prompt for the given goal and tools
Sourcepub fn create_planning_message(goal: &str, tools: &[ToolSchema]) -> LLMMessage
pub fn create_planning_message(goal: &str, tools: &[ToolSchema]) -> LLMMessage
Create an LLM message for plan generation
Sourcepub fn parse_plan(
goal: &str,
response: &str,
) -> Result<ExecutionPlan, PlanParseError>
pub fn parse_plan( goal: &str, response: &str, ) -> Result<ExecutionPlan, PlanParseError>
Parse a plan from LLM JSON response
Sourcepub fn create_replan_prompt(plan: &ExecutionPlan, last_result: &str) -> String
pub fn create_replan_prompt(plan: &ExecutionPlan, last_result: &str) -> String
Create a re-planning prompt
Sourcepub fn apply_replan(
plan: &mut ExecutionPlan,
response: &str,
) -> Result<bool, PlanParseError>
pub fn apply_replan( plan: &mut ExecutionPlan, response: &str, ) -> Result<bool, PlanParseError>
Parse re-planning response and update plan if needed
Auto Trait Implementations§
impl Freeze for PlanGenerator
impl RefUnwindSafe for PlanGenerator
impl Send for PlanGenerator
impl Sync for PlanGenerator
impl Unpin for PlanGenerator
impl UnsafeUnpin for PlanGenerator
impl UnwindSafe for PlanGenerator
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
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>
Converts
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>
Converts
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