pub struct RepairPolicy {
pub reprompt_after: u32,
pub escalate_after: u32,
pub escalate_to: Option<String>,
pub escalate_after_interruptions: Option<u32>,
pub escalate_after_tool_failures: Option<u32>,
}Expand description
A step’s repair policy for the weird paths (silence, no-match, the user
stalling). The stack sets repair:{step}:reprompt once the step has been
active reprompt_after turns without completing, and repair:{step}:escalate
after escalate_after. When escalate_to is set, the authoring layer lowers
an extra edge gated on the escalate signal — a deterministic “give up and
hand off”.
Fields§
§reprompt_after: u32Turns the step may be active before a reprompt signal is raised.
escalate_after: u32Turns the step may be active before an escalation signal is raised.
escalate_to: Option<String>Step to route to on escalation (also completes the current step).
escalate_after_interruptions: Option<u32>Escalate once the user has barged in this many times while the step is active (they keep cutting the model off: it is not working).
escalate_after_tool_failures: Option<u32>Escalate once this many tool calls have failed or timed out while the step is active.
Implementations§
Source§impl RepairPolicy
impl RepairPolicy
Sourcepub fn new(reprompt_after: u32, escalate_after: u32) -> Self
pub fn new(reprompt_after: u32, escalate_after: u32) -> Self
A policy with the given reprompt/escalate turn thresholds.
Sourcepub fn escalate_to(self, step: impl Into<String>) -> Self
pub fn escalate_to(self, step: impl Into<String>) -> Self
Route to step on escalation (also completes the current step).
Sourcepub fn escalate_after_interruptions(self, n: u32) -> Self
pub fn escalate_after_interruptions(self, n: u32) -> Self
Also escalate after n barge-ins while the step is active.
Sourcepub fn escalate_after_tool_failures(self, n: u32) -> Self
pub fn escalate_after_tool_failures(self, n: u32) -> Self
Also escalate after n failed or timed-out tool calls while the step
is active.
Trait Implementations§
Source§impl Clone for RepairPolicy
impl Clone for RepairPolicy
Source§fn clone(&self) -> RepairPolicy
fn clone(&self) -> RepairPolicy
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RepairPolicy
impl Debug for RepairPolicy
Source§impl Default for RepairPolicy
impl Default for RepairPolicy
Source§impl<'de> Deserialize<'de> for RepairPolicy
impl<'de> Deserialize<'de> for RepairPolicy
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>,
Source§impl JsonSchema for RepairPolicy
impl JsonSchema for RepairPolicy
Source§fn schema_name() -> String
fn schema_name() -> String
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref keyword. Read moreSource§impl PartialEq for RepairPolicy
impl PartialEq for RepairPolicy
Source§impl Serialize for RepairPolicy
impl Serialize for RepairPolicy
impl Eq for RepairPolicy
impl StructuralPartialEq for RepairPolicy
Auto Trait Implementations§
impl Freeze for RepairPolicy
impl RefUnwindSafe for RepairPolicy
impl Send for RepairPolicy
impl Sync for RepairPolicy
impl Unpin for RepairPolicy
impl UnwindSafe for RepairPolicy
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
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>
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§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].