Policy and presets
Choose announcement defaults and override timing, detail, and queue limits.
PresetName
Each preset defines a complete set of default values. balanced is the default.
import { createRuntime } from "@generative-a11y/core";
const runtime = createRuntime({ preset: "minimal" });The table compares their announcement behavior; use overrides below to change individual settings.
| Preset | Streaming | Status updates | Workflow updates |
|---|---|---|---|
| minimal | Restrained | Final states | Terminal runs; steps silent |
| balanced | Sentence-paced | Useful status | Terminal runs; long-running steps |
| verbose | More frequent | Progress enabled | All run and step updates |
| completion-only | Final text only | Minimal | Workflow silent |
PolicyOverrides
Nested overrides merge with the selected preset. Unspecified values remain controlled by that preset.
import { createRuntime } from "@generative-a11y/core";
const runtime = createRuntime({
preset: "balanced",
policy: {
text: { minimumCharacters: 48, maximumDelayMs: 1_800 },
tools: { announceProgress: false },
workflows: { steps: "long-running", announceStepAfterMs: 3_000 },
minimumGapMs: 900,
maxQueueSize: 64,
},
});This override reduces text fragmentation, silences tool progress, and caps
pending output at 64 items. balanced supplies every setting not shown.
Prop
Type
Attention policy
attention?: AttentionPolicy is optional and disabled by default. Set
{ enabled: true } to quiet response text and routine starts/progress when
observed attention is background. quietWhen accepts background,
reading-history, and away; its default is ["background"].
attention.changed carries an AttentionMode; attention.override carries
auto, normal, or quiet. Explicit overrides take precedence over
observations. Optional snapshot.attention is a cached, frozen AttentionState
containing observed, override, and effective. Core exports
AttentionMode, AttentionOverride, AttentionPolicy, and AttentionState.
Quiet retains only base-policy-enabled terminal, failure, interaction, connection, citation, and retry notices. Suppressed response text has no backlog; crossing sentence/paragraph units are discarded, and completion strategy cannot replay a response touched by quiet. Read the attention guide.