pub struct PlanningRouter { /* private fields */ }Expand description
Router that applies planning strategies with guard rails.
Implementations§
Source§impl PlanningRouter
impl PlanningRouter
Sourcepub fn new(strategy: PlanningStrategy, config: PlanningConfig) -> Self
pub fn new(strategy: PlanningStrategy, config: PlanningConfig) -> Self
Create a new planning router.
Sourcepub fn with_defaults(strategy: PlanningStrategy) -> Self
pub fn with_defaults(strategy: PlanningStrategy) -> Self
Create a planning router with default configuration.
Sourcepub fn strategy(&self) -> PlanningStrategy
pub fn strategy(&self) -> PlanningStrategy
Get the configured strategy.
Sourcepub fn config(&self) -> &PlanningConfig
pub fn config(&self) -> &PlanningConfig
Get the planning configuration.
Sourcepub fn check_guard_rails(
&self,
current_step: u32,
total_cost_usd: f64,
consecutive_no_ops: u32,
) -> Option<TerminationReason>
pub fn check_guard_rails( &self, current_step: u32, total_cost_usd: f64, consecutive_no_ops: u32, ) -> Option<TerminationReason>
Validate a planning step against guard rails.
Returns Some(TerminationReason) if a limit has been reached,
or None if the step is within limits.
Sourcepub fn explain_termination(
&self,
reason: &TerminationReason,
steps: u32,
cost: f64,
) -> String
pub fn explain_termination( &self, reason: &TerminationReason, steps: u32, cost: f64, ) -> String
Build a partial results explanation for the given termination reason.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PlanningRouter
impl RefUnwindSafe for PlanningRouter
impl Send for PlanningRouter
impl Sync for PlanningRouter
impl Unpin for PlanningRouter
impl UnsafeUnpin for PlanningRouter
impl UnwindSafe for PlanningRouter
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more