pub struct SerializablePlan {
pub plan_id: String,
pub task_description: String,
pub steps: Vec<PlanStep>,
pub created_at: i64,
}Expand description
A serializable execution plan produced by the agent before any side
effects occur. When TaskAgentConfig::plan_budget is set, the agent
generates this plan in a separate provider call and validates it against the
budget; if the budget is exceeded the run fails immediately with
FailureCategory::PlanBudgetExceeded.
Fields§
§plan_id: StringUnique identifier for this plan.
task_description: StringThe original task description the plan was built for.
steps: Vec<PlanStep>Ordered steps in the plan.
created_at: i64Unix timestamp (seconds) when the plan was generated.
Implementations§
Source§impl SerializablePlan
impl SerializablePlan
Sourcepub fn new(task_description: String, steps: Vec<PlanStep>) -> Self
pub fn new(task_description: String, steps: Vec<PlanStep>) -> Self
Create a new plan with a generated ID and the current timestamp.
Sourcepub fn total_estimated_tokens(&self) -> u64
pub fn total_estimated_tokens(&self) -> u64
Sum of all estimated_tokens across steps.
Sourcepub fn step_count(&self) -> u32
pub fn step_count(&self) -> u32
Number of steps in this plan.
Sourcepub fn parse_from_text(task_description: String, text: &str) -> Option<Self>
pub fn parse_from_text(task_description: String, text: &str) -> Option<Self>
Parse a plan from model-generated text that contains an embedded JSON
object with a "steps" array.
Finds the first { … last } span in text, parses the JSON, and
extracts the steps array. Returns None when no valid plan JSON is
found or the steps array is empty.
Trait Implementations§
Source§impl Clone for SerializablePlan
impl Clone for SerializablePlan
Source§fn clone(&self) -> SerializablePlan
fn clone(&self) -> SerializablePlan
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more