Uses of Record Class
com.tnsai.quality.cost.CostBudget
Packages that use CostBudget
-
Uses of CostBudget in com.tnsai.quality.cost
Methods in com.tnsai.quality.cost that return CostBudgetModifier and TypeMethodDescriptionBudgetState.budget()Returns the value of thebudgetrecord component.static CostBudgetCostBudget.forAgent(String tenantId, String agentId, BigDecimal periodBudgetUSD, Duration period, BudgetPolicy onExceed) Convenience: tenant + agent narrowing.static CostBudgetCostBudget.tenantWide(String tenantId, BigDecimal periodBudgetUSD, Duration period, BudgetPolicy onExceed) Convenience: tenant-wide budget, no agent / capability narrowing.Methods in com.tnsai.quality.cost with parameters of type CostBudgetModifier and TypeMethodDescriptionstatic BudgetStateBudgetState.compute(CostBudget budget, BigDecimal spent, Instant evaluatedAt) Build aBudgetStatefrom raw spent + budget values.CostBudgetEvaluator.evaluate(CostBudget budget) Evaluate the budget against current spend in the store.CostBudgetEvaluator.evaluate(CostBudget budget, Instant evaluatedAt) Evaluate as ofevaluatedAt— thenowthe resulting state'sBudgetState.evaluatedAtcarries.Constructors in com.tnsai.quality.cost with parameters of type CostBudgetModifierConstructorDescriptionBudgetState(CostBudget budget, BigDecimal spentUSD, BigDecimal remainingUSD, double fractionConsumed, BudgetState.Status status, Instant evaluatedAt) Creates an instance of aBudgetStaterecord class.Constructor parameters in com.tnsai.quality.cost with type arguments of type CostBudgetModifierConstructorDescriptionCostBudgetEnforcer(CostBudgetStore store, Function<com.tnsai.hooks.events.PreAction, Optional<CostBudget>> budgetResolver) Convenience for the common "don't pre-estimate" case — every call's cost is treated as 0, so the enforcer only fires after the cap is already crossed by recorded spend.CostBudgetEnforcer(CostBudgetStore store, Function<com.tnsai.hooks.events.PreAction, Optional<CostBudget>> budgetResolver, Function<com.tnsai.hooks.events.PreAction, BigDecimal> estimator)