Skip to main content

PlanningAgent

Defined in the specialized module.
Rust AI Agent SDK Planning agent for multi-step task planning

Fields

NameTypeDescription
configPlanningAgentConfigConfiguration
planVec<PlanningStep>Current plan
current_stepusizeCurrent step index

Methods

new

fn new(config: PlanningAgentConfig) -> Self
Create a new planning agent Parameters:
NameType
configPlanningAgentConfig

create_plan

fn create_plan(&mut self, task: &str) -> Vec<PlanningStep>
Create a plan from a task Parameters:
NameType
task&str

add_step

fn add_step(&mut self, description: impl Into<String>) -> ()
Add a step to the plan Parameters:
NameType
descriptionimpl Into&lt;String&gt;

current

fn current(&self) -> Option<&PlanningStep>
Get current step

complete_step

fn complete_step(&mut self, result: Option<String>) -> ()
Mark current step as complete Parameters:
NameType
resultOption&lt;String&gt;

fail_step

fn fail_step(&mut self, error: impl Into<String>) -> ()
Mark current step as failed Parameters:
NameType
errorimpl Into&lt;String&gt;

steps

fn steps(&self) -> &[PlanningStep]
Get all steps

is_complete

fn is_complete(&self) -> bool
Check if plan is complete

progress

fn progress(&self) -> f32
Get progress percentage

Source

View on GitHub

praisonai/src/parity/specialized.rs at line 178