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
| Name | Type | Description |
|---|---|---|
id | String | Plan ID |
name | String | Plan name/goal |
description | Option<String> | Plan description |
steps | Vec<PlanStep> | Steps in the plan |
created_at | chrono::DateTime<chrono::Utc> | Created timestamp |
updated_at | chrono::DateTime<chrono::Utc> | Updated timestamp |
metadata | HashMap<String | Plan metadata |
Methods
new
fn new(name: impl Into<String>) -> SelfCreate a new plan.
Parameters:
| Name | Type |
|---|---|
name | impl Into<String> |
description
fn description(mut self, desc: impl Into<String>) -> SelfSet description.
Parameters:
| Name | Type |
|---|---|
desc | impl Into<String> |
add_step
fn add_step(&mut self, step: PlanStep) -> ()Add a step.
Parameters:
| Name | Type |
|---|---|
step | PlanStep |
get_step
fn get_step(&self, id: &str) -> Option<&PlanStep>Get step by ID.
Parameters:
| Name | Type |
|---|---|
id | &str |
get_step_mut
fn get_step_mut(&mut self, id: &str) -> Option<&mut PlanStep>Get mutable step by ID.
Parameters:
| Name | Type |
|---|---|
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) -> f64Get progress percentage.
is_complete
fn is_complete(&self) -> boolCheck if plan is complete.
has_failed
fn has_failed(&self) -> boolCheck if plan has failed.
step_count
fn step_count(&self) -> usizeGet step count.
Source
View on GitHubpraisonai/src/planning/mod.rs at line 127