Plan • Rust AI Agent SDK

Plan: A plan consisting of multiple steps.

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

rust
fn new(name: impl Into<String>) -> Self

Create a new plan.

Parameters:

NameType
nameimpl Into&lt;String&gt;

description

rust
fn description(mut self, desc: impl Into<String>) -> Self

Set description.

Parameters:

NameType
descimpl Into&lt;String&gt;

add_step

rust
fn add_step(&mut self, step: PlanStep) -> ()

Add a step.

Parameters:

NameType
stepPlanStep

get_step

rust
fn get_step(&self, id: &str) -> Option<&PlanStep>

Get step by ID.

Parameters:

NameType
id&str

get_step_mut

rust
fn get_step_mut(&mut self, id: &str) -> Option<&mut PlanStep>

Get mutable step by ID.

Parameters:

NameType
id&str

completed_steps

rust
fn completed_steps(&self) -> Vec<String>

Get completed step IDs.

next_step

rust
fn next_step(&self) -> Option<&PlanStep>

Get next ready step.

progress

rust
fn progress(&self) -> f64

Get progress percentage.

is_complete

rust
fn is_complete(&self) -> bool

Check if plan is complete.

has_failed

rust
fn has_failed(&self) -> bool

Check if plan has failed.

step_count

rust
fn step_count(&self) -> usize

Get step count.

Source

View on GitHub

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