tool-retry-policy 0.1.0

Declarative retry policy for LLM tool calls: per-tool max-attempts, exponential backoff, jitter, retriable-error filter. Returns a sleep duration; you run the call. Zero deps.
Documentation
  • Coverage
  • 100%
    10 out of 10 items documented1 out of 4 items with examples
  • Size
  • Source code size: 20.12 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 364.53 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 27s Average build duration of successful builds.
  • all releases: 27s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • MukundaKatta/tool-retry-policy
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • MukundaKatta

tool-retry-policy

crates.io

Declarative retry policy primitive. Tells you Retry(duration) or GiveUp; you run the actual call. Exponential backoff, deterministic jitter, per-policy attempt cap.

use tool_retry_policy::{Policy, Decision};
use std::time::Duration;
let p = Policy::default();
match p.next(2) {
    Decision::Retry(d) => println!("sleep {d:?}"),
    Decision::GiveUp => {},
}

Zero deps. MIT or Apache-2.0.