Skip to main content

ai_lib_rust/client/
signals.rs

1use crate::resilience::circuit_breaker::CircuitBreakerSnapshot;
2use crate::resilience::rate_limiter::RateLimiterSnapshot;
3
4/// A lightweight, provider-agnostic snapshot of runtime "signals" for orchestration.
5///
6/// This is intentionally *facts only* (no policy). Applications can build scoring/selection
7/// strategies on top of these signals.
8#[derive(Debug, Clone, Default)]
9pub struct SignalsSnapshot {
10    pub inflight: Option<InflightSnapshot>,
11    pub rate_limiter: Option<RateLimiterSnapshot>,
12    pub circuit_breaker: Option<CircuitBreakerSnapshot>,
13}
14
15#[derive(Debug, Clone)]
16pub struct InflightSnapshot {
17    pub max: usize,
18    pub available: usize,
19    pub in_use: usize,
20}