Refactor wake phrase handling: introduce REQUIRE_WAKE_WORD configuration, update documentation, and adjust assistant behavior for improved user experience.

This commit is contained in:
TheMajesticMagician
2026-10-25 22:48:37 -06:00
parent ca65670638
commit a8c7db9520
7 changed files with 84 additions and 54 deletions
+8 -1
View File
@@ -56,11 +56,18 @@ MIC_DEVICE = _device(os.environ.get("MIC_DEVICE", ""))
SPEAKER_DEVICE = _device(os.environ.get("SPEAKER_DEVICE", ""))
# ── wake phrases ────────────────────────────────────────────────────────────
# With REQUIRE_WAKE_WORD off (the default) the mic itself is the activation:
# every utterance the local detector passes on is treated as a request, and
# whatever is said near an open mic gets answered. Set it to true to go back
# to needing a phrase before each request.
REQUIRE_WAKE_WORD = _flag("REQUIRE_WAKE_WORD", "false")
# Heard through the server's speech-to-text, so these are matched against
# *text*. A phrase counts only near the start of what was said ("hey bolt,
# what's the time"), not buried in a sentence ("tighten that bolt"). Speech
# recognisers often write "Bolt" as "bolts"/"volt"/"bold"; those spellings
# only count after "hey"/"ok", where they can't be ordinary words.
# only count after "hey"/"ok", where they can't be ordinary words. Only used
# when REQUIRE_WAKE_WORD is on (a phrase said anyway is still stripped).
WAKE_WORDS = [w.strip().lower() for w in os.environ.get(
"WAKE_WORDS",