Interface IBudgetTracker
- Namespace
- JD.AI.Core.Governance
- Assembly
- JD.AI.Core.dll
Tracks AI provider spending against daily and monthly budget limits.
public interface IBudgetTracker
Methods
GetStatusAsync(CancellationToken)
Returns the current spending status.
Task<BudgetStatus> GetStatusAsync(CancellationToken ct = default)
Parameters
Returns
IsWithinBudgetAsync(BudgetPolicy?, CancellationToken)
Returns true when the current spend is within the configured limits.
If policy is null, always returns true.
Task<bool> IsWithinBudgetAsync(BudgetPolicy? policy, CancellationToken ct = default)
Parameters
policyBudgetPolicyctCancellationToken
Returns
RecordSpendAsync(decimal, string, CancellationToken)
Records spend for a provider interaction.
Task RecordSpendAsync(decimal amountUsd, string providerName, CancellationToken ct = default)
Parameters
amountUsddecimalproviderNamestringctCancellationToken