Class AiQuotaServiceImpl

java.lang.Object
com.axelor.ai.governance.AiQuotaServiceImpl
All Implemented Interfaces:
AiQuotaService

@Singleton public class AiQuotaServiceImpl extends Object implements AiQuotaService
  • Constructor Details

    • AiQuotaServiceImpl

      @Inject public AiQuotaServiceImpl(AiPermissionService permissionService)
  • Method Details

    • checkMonthlyTokenQuota

      public void checkMonthlyTokenQuota(User user)
      Description copied from interface: AiQuotaService
      Throws AiException when the user's chat-panel turns (CHAT) have consumed at least as many tokens as their role-resolved monthly quota. Programmatic and background calls never count. Admins and users with no quota set are always permitted.
      Specified by:
      checkMonthlyTokenQuota in interface AiQuotaService
    • tokenQuotaMonthly

      public Integer tokenQuotaMonthly(User user)
      Description copied from interface: AiQuotaService
      Monthly token budget (inputTokens + outputTokens) for the user. null means unlimited — the case for admins and users no AiUsagePolicy applies to.
      Specified by:
      tokenQuotaMonthly in interface AiQuotaService
    • rateLimit

      public Integer rateLimit(User user)
      Description copied from interface: AiQuotaService
      Per-user rate limit in requests/second. null means no limit — admins, and users no AiUsagePolicy applies to.
      Specified by:
      rateLimit in interface AiQuotaService