Planning Agent • Rust AI Agent SDK

PlanningAgent: Planning agent for multi-step task planning

PlanningAgent

Defined in the specialized module.

Rust AI Agent SDK

Planning agent for multi-step task planning

Diagram

Input Data

Agent: PlanningAgent

Output Result

Fields

NameTypeDescription
configPlanningAgentConfigConfiguration
planVec<PlanningStep>Current plan
current_stepusizeCurrent step index

Methods

new

rust
fn new(config: PlanningAgentConfig) -> Self

Create a new planning agent

Parameters:

NameType
configPlanningAgentConfig

create_plan

rust
fn create_plan(&mut self, task: &str) -> Vec<PlanningStep>

Create a plan from a task

Parameters:

NameType
task&str

add_step

rust
fn add_step(&mut self, description: impl Into<String>) -> ()

Add a step to the plan

Parameters:

NameType
descriptionimpl Into&lt;String&gt;

current

rust
fn current(&self) -> Option<&PlanningStep>

Get current step

complete_step

rust
fn complete_step(&mut self, result: Option<String>) -> ()

Mark current step as complete

Parameters:

NameType
resultOption&lt;String&gt;

fail_step

rust
fn fail_step(&mut self, error: impl Into<String>) -> ()

Mark current step as failed

Parameters:

NameType
errorimpl Into&lt;String&gt;

steps

rust
fn steps(&self) -> &[PlanningStep]

Get all steps

is_complete

rust
fn is_complete(&self) -> bool

Check if plan is complete

progress

rust
fn progress(&self) -> f32

Get progress percentage

Source

View on GitHub

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


Related Documentation