Add gated turn start strategy

This commit is contained in:
Xin Wang
2026-05-22 13:36:47 +08:00
parent 2c7f0f440b
commit 75a34bf071
6 changed files with 190 additions and 0 deletions

View File

@@ -154,6 +154,9 @@ before declaring the turn done) is configurable per environment:
"stop_secs": 0.6,
"min_volume": 0.6
},
"interruption_min_chars": 3,
"interruption_use_interim": true,
"interruption_short_replies": ["是的", "行", "可以"],
"user_speech_timeout_sec": 1.0
}
```
@@ -162,6 +165,13 @@ before declaring the turn done) is configurable per environment:
controls the Silero VAD. `stop_secs` is the duration of silence required
before VAD reports the user stopped speaking; raise it if VAD is
cutting users off mid-clause, lower it for snappier turn-taking.
- `interruption_min_chars`, `interruption_use_interim`, and
`interruption_short_replies` configure the custom turn-start gate used
while the assistant is speaking. Short replies in the allowlist (for
example, `是的`, `行`, `可以`) can barge in immediately; other text must
contain at least `interruption_min_chars` countable characters after
punctuation and spaces are removed. This keeps common yes/no answers while
filtering brief background speech.
- `user_speech_timeout_sec` is the additional grace window (used by
`SpeechTimeoutUserTurnStopStrategy`) during which the user may resume
speaking before the aggregator finalizes the turn. The timer is