feat(backend): send the campaign vocabulary as hotwords, on a switch (#577) #578
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/577-asr-hotwords"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #577.
What. The bundled WhisperX server accepts the campaign vocabulary either as an
initial_prompt(what the app has always sent) or ashotwords, faster-whisper's purpose-built term bias. This addsVocabularyStyle.HOTWORDSand a worker switch,QB_ASR_VOCABULARY_STYLE=initial_prompt|hotwords|none, defaulting toinitial_promptso nothing changes for anyone who does not set it.hotwordsfalls back to the prompt, with a warning, on a server that does not declare it;noneis the control arm and skips the wiki query entirely. The style actually used is stamped on the summarisation run (vocabulary_style, migration4f5a6b7c8d9e, nullable, not backfilled) and surfaced on the run API, so a comparison can be read back later.Verified against the live server, not assumed. With an invented fixture clip that says "Stillbrook": no vocabulary → Stillbrook;
hotwords="Stilbroque, …"→ Stilbrooke; a misspelt field name → Stillbrook (so the field is read, not silently dropped); and both fields together → the prompt wins and hotwords are ignored. That last point is why the request tests assert the other field is absent, not merely that the right one is present: sending both would be a comparison that never runs.Design notes.
caps.vocabularyholds the effective style after reconciling the switch with/health, so the request field, the log line, the capability panel and the stored value cannot disagree. The style is captured right afterresolve_asr_vocabulary, before per-span failures can invalidate the capability cache. The switch is scoped to the bundled adapter: the OpenAI-compatible path has onlyprompton the wire. One accepted gap: withnoneset, the capability panel's remedy text still suggests updating the server; documented in OPERATIONS.md rather than fixed, since fixing it means carrying the raw declaration separately.Tests: 21 new in
test_asr_hotwords.py; full backend suite 2,985 passed; migration upgraded, downgraded and re-upgraded on a real database.🤖 Generated with Claude Code