Plan Step • Rust AI Agent SDK
PlanStep: A single step in a plan.
PlanStep
Defined in the planning module.
Rust AI Agent SDK
A single step in a plan.
Fields
| Name | Type | Description |
|---|---|---|
id | String | Step ID |
description | String | Step description |
status | StepStatus | Step status |
dependencies | Vec<String> | Dependencies (step IDs) |
output | Option<String> | Output from this step |
error | Option<String> | Error message if failed |
estimated_duration | Option<u64> | Estimated duration in seconds |
actual_duration | Option<u64> | Actual duration in seconds |
Methods
new
fn new(description: impl Into<String>) -> SelfCreate a new plan step.
Parameters:
| Name | Type |
|---|---|
description | impl Into<String> |
depends_on
fn depends_on(mut self, step_id: impl Into<String>) -> SelfAdd a dependency.
Parameters:
| Name | Type |
|---|---|
step_id | impl Into<String> |
estimated
fn estimated(mut self, seconds: u64) -> SelfSet estimated duration.
Parameters:
| Name | Type |
|---|---|
seconds | u64 |
start
fn start(&mut self) -> ()Mark as in progress.
complete
fn complete(&mut self, output: Option<String>) -> ()Mark as completed.
Parameters:
| Name | Type |
|---|---|
output | Option<String> |
fail
fn fail(&mut self, error: impl Into<String>) -> ()Mark as failed.
Parameters:
| Name | Type |
|---|---|
error | impl Into<String> |
skip
fn skip(&mut self) -> ()Mark as skipped.
is_ready
fn is_ready(&self, completed_steps: &[String]) -> boolCheck if step is ready to execute.
Parameters:
| Name | Type |
|---|---|
completed_steps | &[String] |
Source
View on GitHubpraisonai/src/planning/mod.rs at line 46