pub struct ReplanContext {
pub goal: String,
pub completed_steps: Vec<String>,
pub failed_step: String,
pub error: String,
pub current_state: PageState,
pub previous_plan: Option<ExecutionPlan>,
}Expand description
Context for re-planning after a failure.
Fields§
§goal: StringOriginal goal.
completed_steps: Vec<String>Steps that were completed.
failed_step: StringStep that failed.
error: StringError that caused the failure.
current_state: PageStateCurrent page state (URL, title, etc.).
previous_plan: Option<ExecutionPlan>Previous plan for reference.
Implementations§
Source§impl ReplanContext
impl ReplanContext
Sourcepub fn new(
goal: impl Into<String>,
failed_step: impl Into<String>,
error: impl Into<String>,
current_state: PageState,
) -> Self
pub fn new( goal: impl Into<String>, failed_step: impl Into<String>, error: impl Into<String>, current_state: PageState, ) -> Self
Create a new re-plan context.
Sourcepub fn with_completed(self, steps: Vec<String>) -> Self
pub fn with_completed(self, steps: Vec<String>) -> Self
Set completed steps.
Sourcepub fn with_previous_plan(self, plan: ExecutionPlan) -> Self
pub fn with_previous_plan(self, plan: ExecutionPlan) -> Self
Set previous plan.
Trait Implementations§
Source§impl Clone for ReplanContext
impl Clone for ReplanContext
Source§fn clone(&self) -> ReplanContext
fn clone(&self) -> ReplanContext
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 ReplanContext
impl Debug for ReplanContext
Source§impl<'de> Deserialize<'de> for ReplanContext
impl<'de> Deserialize<'de> for ReplanContext
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ReplanContext
impl RefUnwindSafe for ReplanContext
impl Send for ReplanContext
impl Sync for ReplanContext
impl Unpin for ReplanContext
impl UnwindSafe for ReplanContext
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