Documentation
¶
Overview ¶
Package outputpolicy reduces the tokens a model *generates* (the output side of the bill, complementary to the input/context compression in cli/compress).
Two keyless levers, both standard practice:
- Verbosity steering: a static, cache-friendly directive injected into the system prompt that tells the model to drop preamble, restatement and ceremony and lead with the answer/action. Levels: full (off), concise, minimal.
- Effort right-sizing: a keyless complexity classifier so trivial requests don't burn extended-thinking/reasoning tokens. It only ever *lowers* effort for clearly-trivial prompts; it never forces more thinking, so it cannot degrade a hard task.
The package is a leaf (standard library only) so it can be imported by the agent loop and the chat pipeline without cycles. The directives are model-facing instructions and are intentionally hard-coded in English (the repo convention: models follow English directives most reliably).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Complexity ¶
type Complexity int
Complexity is the classifier's verdict about a user prompt.
const ( // ComplexityNormal is the default — no effort change. ComplexityNormal Complexity = iota // ComplexityTrivial is a short, conversational lookup that doesn't need // extended thinking. ComplexityTrivial // ComplexityComplex is a multi-step / design / debugging task. ComplexityComplex )
func Classify ¶
func Classify(prompt string) Complexity
Classify returns a keyless complexity verdict for a user prompt. It is used only to *lower* effort for trivial prompts; ComplexityComplex/Normal leave effort untouched, so misclassification never reduces thinking on a hard task.
type Verbosity ¶
type Verbosity int
Verbosity selects how terse the model should be.
const ( // VerbosityFull applies no steering — the model's natural verbosity. VerbosityFull Verbosity = iota // VerbosityConcise drops ceremony and restatement while keeping substance. // This is the recommended default. VerbosityConcise // VerbosityMinimal answers in the fewest correct tokens. VerbosityMinimal )
func ParseVerbosity ¶
ParseVerbosity maps a config/env string to a Verbosity. Unknown values fall back to VerbosityConcise (the recommended default) with ok=false.