Class InMemoryBudgetEnforcer

Assembly: redb.Route.Llm.dll

In-process budget enforcer — checks components against the running
total. Does NOT persist between runs and takes no store: cross-run budgets need a custom
over an .

public sealed class InMemoryBudgetEnforcer : IBudgetEnforcer

Inheritance

Object→InMemoryBudgetEnforcer

Implements

Methods

PreCheckAsync(string?, AgentBudget, AgentUsage, CancellationToken)

Checks whether the agent run is allowed to continue at the start of an

public ValueTask<BudgetDecision> PreCheckAsync(string? conversationId, AgentBudget budget, AgentUsage usageSoFar, CancellationToken ct = default)

RecordAndCheckAsync(string?, AgentBudget, AgentUsage, AgentUsage, CancellationToken)

Records usage produced by the iteration and returns a decision whether the agent may

public ValueTask<BudgetDecision> RecordAndCheckAsync(string? conversationId, AgentBudget budget, AgentUsage iterationUsage, AgentUsage totalUsage, CancellationToken ct = default)