pub struct ExecutionPlan {
pub goal: String,
pub reasoning: Option<String>,
pub steps: Vec<PlannedStep>,
pub confidence: f64,
pub is_complete: bool,
pub expected_outcome: Option<String>,
}Expand description
An execution plan from the LLM.
Fields§
§goal: StringThe goal this plan aims to achieve.
reasoning: Option<String>Reasoning for the plan (optional).
steps: Vec<PlannedStep>Steps to execute.
confidence: f64Overall confidence in the plan.
is_complete: boolWhether the plan is complete (achieves the goal).
expected_outcome: Option<String>Expected final state after execution.
Implementations§
Source§impl ExecutionPlan
impl ExecutionPlan
Sourcepub fn new(goal: impl Into<String>) -> ExecutionPlan
pub fn new(goal: impl Into<String>) -> ExecutionPlan
Create a new execution plan.
Sourcepub fn add_step(self, step: PlannedStep) -> ExecutionPlan
pub fn add_step(self, step: PlannedStep) -> ExecutionPlan
Add a step.
Sourcepub fn with_reasoning(self, reasoning: impl Into<String>) -> ExecutionPlan
pub fn with_reasoning(self, reasoning: impl Into<String>) -> ExecutionPlan
Set reasoning.
Sourcepub fn with_confidence(self, confidence: f64) -> ExecutionPlan
pub fn with_confidence(self, confidence: f64) -> ExecutionPlan
Set confidence.
Sourcepub fn complete(self) -> ExecutionPlan
pub fn complete(self) -> ExecutionPlan
Mark as complete.
Sourcepub fn with_expected_outcome(self, outcome: impl Into<String>) -> ExecutionPlan
pub fn with_expected_outcome(self, outcome: impl Into<String>) -> ExecutionPlan
Set expected outcome.
Sourcepub fn from_json(value: &Value) -> Option<ExecutionPlan>
pub fn from_json(value: &Value) -> Option<ExecutionPlan>
Parse from LLM JSON response.
Sourcepub fn step_count(&self) -> usize
pub fn step_count(&self) -> usize
Get the number of steps.
Sourcepub fn average_step_confidence(&self) -> f64
pub fn average_step_confidence(&self) -> f64
Get the average confidence of steps.
Sourcepub fn steps_with_checkpoints(&self) -> Vec<&PlannedStep>
pub fn steps_with_checkpoints(&self) -> Vec<&PlannedStep>
Get steps that have checkpoints.
Sourcepub fn critical_steps(&self) -> Vec<&PlannedStep>
pub fn critical_steps(&self) -> Vec<&PlannedStep>
Get critical steps.
Trait Implementations§
Source§impl Clone for ExecutionPlan
impl Clone for ExecutionPlan
Source§fn clone(&self) -> ExecutionPlan
fn clone(&self) -> ExecutionPlan
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ExecutionPlan
impl Debug for ExecutionPlan
Source§impl<'de> Deserialize<'de> for ExecutionPlan
impl<'de> Deserialize<'de> for ExecutionPlan
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ExecutionPlan, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ExecutionPlan, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for ExecutionPlan
impl Serialize for ExecutionPlan
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for ExecutionPlan
impl RefUnwindSafe for ExecutionPlan
impl Send for ExecutionPlan
impl Sync for ExecutionPlan
impl Unpin for ExecutionPlan
impl UnsafeUnpin for ExecutionPlan
impl UnwindSafe for ExecutionPlan
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more