Repository navigation
openaichat: more fast-path speaker commands - #25
Merged
Merged
Conversation
«поставь громкость на половину», «на максимум», «на всю» 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.
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Extends the opt-in fast path (
fast_path: true) so more short speaker commands skip the text model:сделай громче на 20,тише на 5— the step is read from the phrase (default 10, capped at 50).без звука.какое сегодня число,какой день недели— answered from the existingtime_nowskill, no extra call.включи сцену Спокойной ночи—yandex_home_find+yandex_home_scene.яркость в зале 40,поставь яркость торшера 50—yandex_home_find+yandex_home_controlwithset_brightness; several matches ask for a room instead of guessing.commandRE(установи,запусти,активируй,выполни) andяркость.Also,
stripWakeWordnow 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 vetandgo test ./internal/provider/openaichat/pass.TestFastPathRegexis untouched and still passes.No new dependencies; the change is limited to
internal/provider/openaichat/fastpath.goand one test file.