Class BudgetExceededException

java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.tnsai.exceptions.TnsAIException
com.tnsai.quality.cost.BudgetExceededException
All Implemented Interfaces:
Serializable

public class BudgetExceededException extends com.tnsai.exceptions.TnsAIException
Thrown by CostBudgetEnforcer when an LLM call would exceed a configured CostBudget under BudgetPolicy.HARD_STOP (issue #82).

Carries the budget identity (tenant / agent / capability / period), the measured spend, the budget cap, and the estimated cost of the blocked call so the caller can either fall back to a cheaper model, defer the work, or surface a clear "budget exhausted" signal to the user.

Since:
0.10.0 (issue #82 closeout — cost-governance hook wiring)
See Also:
  • Constructor Details

    • BudgetExceededException

      public BudgetExceededException(String tenantId, String scope, BigDecimal budgetUSD, BigDecimal spentUSD, BigDecimal estimatedUSD)
      Parameters:
      tenantId - tenant whose budget was hit
      scope - human-readable scope label (e.g. "tenant", "agent:foo", "capability:summarise")
      budgetUSD - configured cap for the period
      spentUSD - cumulative spend already recorded
      estimatedUSD - pre-call estimate that pushed over the cap
  • Method Details

    • getTenantId

      public String getTenantId()
    • getScope

      public String getScope()
    • getBudgetUSD

      public BigDecimal getBudgetUSD()
    • getSpentUSD

      public BigDecimal getSpentUSD()
    • getEstimatedUSD

      public BigDecimal getEstimatedUSD()