from pydantic import Field from pydantic_settings import BaseSettings, SettingsConfigDict from typing import List class ReadRateLimited(BaseSettings): """限流配置""" # 统计周期 stat_durations: List[int] = Field( default_factory=lambda: [2, 10, 30, 60, 90, 120, 150, 365] ) # 认为满足限流阅读均值倍数阈值 read_on_avg_threshold: float = 0.25 # 探索次数 base_discover_time: int = 1 # 文章限流占比阈值 low_read_rate_threshold: float = 0.3 # 周期内最多限流篇数 MAX_RATE_LIMITED_ARTICLES: int = 2 # 持续限流天数 CONSIST_DAYS: int = 2