Skip to content

openaichat: more fast-path speaker commands - #25

Merged
yawaflua merged 2 commits into
yawaflua:stagefrom
ryysel:pr/fastpath-phrases
Nov 3, 2026
Merged

yawaflua merged 2 commits into
yawaflua:stagefrom
ryysel:pr/fastpath-phrases

Conversation

@ryysel

@ryysel ryysel commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

What

Extends the opt-in fast path (fast_path: true) so more short speaker commands skip the text model:

  • Relative volume: сделай громче на 20, тише на 5 — the step is read from the phrase (default 10, capped at 50).
  • Mute shorthand: без звука.
  • Date and weekday: какое сегодня число, какой день недели — answered from the existing time_now skill, no extra call.
  • Scenes: включи сцену Спокойной ночи — yandex_home_find + yandex_home_scene.
  • Brightness: яркость в зале 40, поставь яркость торшера 50 — yandex_home_find + yandex_home_control with set_brightness; several matches ask for a room instead of guessing.
  • More verbs in commandRE (установи, запусти, активируй, выполни) and яркость.

Also, stripWakeWord now strips only маруся: алиса is no longer treated as a wake word, and a transcript that happens to start with it is passed through unchanged.

Why

The fast path exists for slow or offline backends. Dates, scenes and brightness are the requests that are still common after the wake word, and each one currently costs a full model round trip. The regexes stay anchored and conservative: anything ambiguous falls through to the model.

Tests

  • go vet and go test ./internal/provider/openaichat/ pass.
  • New table tests cover the date, brightness (device, room and number-first forms), scene and relative-volume regexes, the wake-word strip and the Russian date reply.
  • The existing TestFastPathRegex is untouched and still passes.

No new dependencies; the change is limited to internal/provider/openaichat/fastpath.go and one test file.

«поставь громкость на половину», «на максимум», «на всю» fell through to
the text model: only digits matched volumeSetRE. With the cloud model rate
limited, the command was executed by a tool call but the confirmation never
came. Level words are now resolved in the fast path, next to the digit
form, so the answer is immediate and local.
@yawaflua
yawaflua merged commit 81ffb35 into yawaflua:stage Nov 3, 2026
7 checks passed
@yawaflua yawaflua mentioned this pull request Nov 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants