symfonic.capabilities.prompting.values¶
values ¶
The values a prompt compile produces.
:class:CompiledPrompt is the whole output: the regions a provider caches, the
contributions that survived, the budget arithmetic, and a diagnostic record of
everything that was dropped and why. It is frozen and self-describing on
purpose — an adopter debugging "why is my block missing" reads the diagnostics
instead of re-running the compile with print statements.
BudgetReport
dataclass
¶
BudgetReport(limit: int | None = None, total_tokens: int = 0, admitted: tuple[str, ...] = (), dropped: tuple[str, ...] = ())
The budget arithmetic, kept alongside the prompt it explains.
CompiledPrompt
dataclass
¶
CompiledPrompt(strategy: str, regions: tuple[CacheRegion, ...] = (), contributions: tuple[RenderedContribution, ...] = (), budget: BudgetReport = BudgetReport(), diagnostics: tuple[PromptDiagnostic, ...] = (), digest: str = '')
PromptDiagnostic
dataclass
¶
One recorded compile decision.
kind is the stage that made it (input, strategy, source,
gate, budget, cache), subject the contribution it concerns.
Diagnostics are data rather than log lines because the caller that needs
them most — a test asserting a block was dropped for the right reason — has
no access to a log handler.
RenderedContribution
dataclass
¶
RenderedContribution(contribution_id: str, layer: Layer, tier: TrustTier, text: str, revision: str, tokens: int, directive: CacheDirective, pinned: bool, degraded: bool = False)
One contribution after gating, with its cost and cache annotation fixed.
prompt_digest ¶
A stable identity for a compiled prompt.
Computed over the region digests and their annotations, not over the joined text: two prompts with identical bytes but different breakpoints are different cache plans, and a digest that could not tell them apart would be useless as a cache key.