pub struct LlmRetryPolicy {
pub max_attempts_per_model: usize,
pub initial_backoff_ms: u64,
pub max_backoff_ms: u64,
pub backoff_jitter_percent: u8,
pub max_retry_window_ms: Option<u64>,
pub retry_stream_start: bool,
pub max_stream_event_retries: usize,
pub stream_error_fallback_threshold: usize,
}Expand description
Retry strategy for LLM inference calls.
Fields§
§max_attempts_per_model: usizeMax attempts per model candidate (must be >= 1).
initial_backoff_ms: u64Initial backoff for retries in milliseconds.
max_backoff_ms: u64Max backoff cap in milliseconds.
backoff_jitter_percent: u8Random jitter applied around the exponential backoff base, expressed as a percentage of the computed delay.
max_retry_window_ms: Option<u64>Maximum wall-clock retry window in milliseconds for one retry sequence. When exceeded, no further retry backoff is scheduled.
retry_stream_start: boolRetry stream startup failures before any output is emitted.
max_stream_event_retries: usizeMax retryable mid-stream recovery attempts across a single run.
stream_error_fallback_threshold: usizeConsecutive mid-stream failures on one model before escalating to the next fallback model.
Trait Implementations§
Source§impl Clone for LlmRetryPolicy
impl Clone for LlmRetryPolicy
Source§fn clone(&self) -> LlmRetryPolicy
fn clone(&self) -> LlmRetryPolicy
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 LlmRetryPolicy
impl Debug for LlmRetryPolicy
Auto Trait Implementations§
impl Freeze for LlmRetryPolicy
impl RefUnwindSafe for LlmRetryPolicy
impl Send for LlmRetryPolicy
impl Sync for LlmRetryPolicy
impl Unpin for LlmRetryPolicy
impl UnsafeUnpin for LlmRetryPolicy
impl UnwindSafe for LlmRetryPolicy
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