symfonic.platform.prompt_budget¶
prompt_budget ¶
Bind prompt accounting in a native AgentHost composer.
This is prompt compilation, distinct from :mod:symfonic.platform.budget's
invocation admission ledger. A declared window and prompt share grant a
ceiling; omitting either leaves the prompt unbounded (a share alone is refused).
For example, inside AgentHost(composer=compose, resources=resources)::
def compose(scope, resources):
return Agent(resources.provider, capabilities=[
PromptingCapability(
sources=resources.prompt_sources(scope),
options=prompt_compile_options(context_window=8192, prompt_share=0.5),
),
])
The shared facade compiler binds service ports to capability values. Keeping that binding outside cutover lets native hosts compose it after cutover removal, while the compatibility root can reuse it without importing the platform.
prompt_compile_options ¶
prompt_compile_options(*, context_window: int | None = None, prompt_share: float | None = None, chars_per_token: int | None = None) -> dict[str, Any]
The compile options that bind this deployment's budgeting.
Returned as options for PromptingCapability rather than applied here:
the capability owns the compile, and a composition root that pre-compiled
for it would be a second compiler.