Change headers and struct of rate limits (#4060)

This commit is contained in:
Ahmed Ibrahim
2025-09-22 14:06:20 -07:00
committed by GitHub
parent 8bc73a2bfd
commit dd56750612
5 changed files with 39 additions and 34 deletions

View File

@@ -596,14 +596,14 @@ pub struct TokenCountEvent {
pub struct RateLimitSnapshotEvent {
/// Percentage (0-100) of the primary window that has been consumed.
pub primary_used_percent: f64,
/// Percentage (0-100) of the protection window that has been consumed.
pub weekly_used_percent: f64,
/// Size of the primary window relative to weekly (0-100).
pub primary_to_weekly_ratio_percent: f64,
/// Percentage (0-100) of the secondary window that has been consumed.
pub secondary_used_percent: f64,
/// Size of the primary window relative to secondary (0-100).
pub primary_to_secondary_ratio_percent: f64,
/// Rolling window duration for the primary limit, in minutes.
pub primary_window_minutes: u64,
/// Rolling window duration for the weekly limit, in minutes.
pub weekly_window_minutes: u64,
/// Rolling window duration for the secondary limit, in minutes.
pub secondary_window_minutes: u64,
}
// Includes prompts, tools and space to call compact.