symfonic.capabilities.prompting.budgeting¶
budgeting ¶
Step 6, as the compiled value reports it: admission under the budget.
Split out of :mod:.compiler for the 300-line module budget, and the split
lands here rather than in :mod:.budget because of the import direction:
:mod:.request imports :mod:.budget, so the arithmetic that needs a
PromptCompileRequest cannot live there without a cycle. :mod:.budget owns
the rule -- the drop order and what pinned means -- and this module owns the
one call that applies it to a compile and records what it cost.
apply_budget ¶
apply_budget(request: PromptCompileRequest, rendered: tuple[RenderedContribution, ...], diagnostics: list[PromptDiagnostic]) -> tuple[RenderedContribution, ...]
Step 6: admission under the budget, in the fixed drop order.
Source code in src/symfonic/capabilities/prompting/budgeting.py
budget_report ¶
budget_report(request: PromptCompileRequest, rendered: tuple[RenderedContribution, ...], survivors: tuple[RenderedContribution, ...]) -> BudgetReport
The budget arithmetic as the compiled value reports it.