Class AiRateLimiter

java.lang.Object
com.axelor.ai.chat.provider.AiRateLimiter

@Singleton public class AiRateLimiter extends Object
Per-model rate limiter, keyed by model code with the model's configured rateLimit.
  • Constructor Details

    • AiRateLimiter

      public AiRateLimiter()
  • Method Details

    • acquire

      public void acquire(String key, Integer maxRps)
      Acquires a permit for the given key, blocking while the rate limit is reached. No-op when the key is null or the rate limit is null / non-positive.
      Parameters:
      key - unique identifier of what is limited
      maxRps - max requests per second