pub struct Retry {
pub max_attempts: u32,
pub initial_delay: Duration,
pub max_delay: Duration,
pub multiplier: f64,
}Expand description
Retry interceptor with exponential backoff.
Retries the operation when the output indicates failure via Retryable.
§Example
ⓘ
use llm_stack::intercept::{InterceptorStack, Retry, ToolExec};
use std::time::Duration;
let stack = InterceptorStack::<ToolExec<()>>::new()
.with(Retry::new(3, Duration::from_millis(100)));Fields§
§max_attempts: u32Maximum number of attempts (including the first).
initial_delay: DurationInitial delay before first retry.
max_delay: DurationMaximum delay between retries.
multiplier: f64Multiplier for exponential backoff.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Retry
impl RefUnwindSafe for Retry
impl Send for Retry
impl Sync for Retry
impl Unpin for Retry
impl UnwindSafe for Retry
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