Skip to main content

Plan

Defined in the planning module.
Rust AI Agent SDK A plan consisting of multiple steps.

Fields

NameTypeDescription
idStringPlan ID
nameStringPlan name/goal
descriptionOption<String>Plan description
stepsVec<PlanStep>Steps in the plan
created_atchrono::DateTime<chrono::Utc>Created timestamp
updated_atchrono::DateTime<chrono::Utc>Updated timestamp
metadataHashMap<StringPlan metadata

Methods

new

fn new(name: impl Into<String>) -> Self
Create a new plan. Parameters:
NameType
nameimpl Into&lt;String&gt;

description

fn description(mut self, desc: impl Into<String>) -> Self
Set description. Parameters:
NameType
descimpl Into&lt;String&gt;

add_step

fn add_step(&mut self, step: PlanStep) -> ()
Add a step. Parameters:
NameType
stepPlanStep

get_step

fn get_step(&self, id: &str) -> Option<&PlanStep>
Get step by ID. Parameters:
NameType
id&str

get_step_mut

fn get_step_mut(&mut self, id: &str) -> Option<&mut PlanStep>
Get mutable step by ID. Parameters:
NameType
id&str

completed_steps

fn completed_steps(&self) -> Vec<String>
Get completed step IDs.

next_step

fn next_step(&self) -> Option<&PlanStep>
Get next ready step.

progress

fn progress(&self) -> f64
Get progress percentage.

is_complete

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

has_failed

fn has_failed(&self) -> bool
Check if plan has failed.

step_count

fn step_count(&self) -> usize
Get step count.

Source

View on GitHub

praisonai/src/planning/mod.rs at line 127