diff --git a/api/core/provider_manager.py b/api/core/provider_manager.py index a2c9dde63c..489af29460 100644 --- a/api/core/provider_manager.py +++ b/api/core/provider_manager.py @@ -957,7 +957,7 @@ class ProviderManager: is_valid=trail_pool.quota_limit > trail_pool.quota_used or trail_pool.quota_limit == -1, restrict_models=provider_quota.restrict_models, ) - + elif provider_quota.quota_type == ProviderQuotaType.PAID and paid_pool is not None: quota_configuration = QuotaConfiguration( quota_type=provider_quota.quota_type, diff --git a/api/core/workflow/nodes/llm/llm_utils.py b/api/core/workflow/nodes/llm/llm_utils.py index 194ad43151..0af4024d3e 100644 --- a/api/core/workflow/nodes/llm/llm_utils.py +++ b/api/core/workflow/nodes/llm/llm_utils.py @@ -136,15 +136,16 @@ def deduct_llm_quota(tenant_id: str, model_instance: ModelInstance, usage: LLMUs used_quota = 1 if used_quota is not None and system_configuration.current_quota_type is not None: - if system_configuration.current_quota_type == ProviderQuotaType.TRIAL: from services.credit_pool_service import CreditPoolService + CreditPoolService.check_and_deduct_credits( tenant_id=tenant_id, credits_required=used_quota, ) elif system_configuration.current_quota_type == ProviderQuotaType.PAID: from services.credit_pool_service import CreditPoolService + CreditPoolService.check_and_deduct_credits( tenant_id=tenant_id, credits_required=used_quota,