You can make the assistant start speaking when it detects specific patterns in what the user says. This is done using custom rules combined with timeouts to decide when the assistant should listen and when it should respond.
How Rules are Checked (Precedence)
- Custom Rules Come First – If a custom rule matches, it takes priority over everything else, like default settings or smart endpointing.
- First Match Wins – The rules are checked in order. Once a rule matches, it stops looking at the others.
Timeout Rules (How Long to Wait)
The timeoutSeconds
setting controls how long the assistant waits before deciding the user has finished speaking.
- Short Timeouts (0.5s - 1s): For quick answers like "yes" or "no".
- Longer Timeouts (2s - 3s): For detailed replies, like spelling names or reading numbers.
How it Works:
- The timer starts when a match happens.
- If the user pauses but continues talking within the timeout, the timer resets—so the assistant doesn’t cut them off too early.
Types of Custom Rules
1. Assistant Rules – Look at what the assistant just said.
Example: Start early if asking a yes/no question.
{
type: 'assistant',
regex: 'yes|no',
timeoutSeconds: 0.5,
}
Why? Works for quick answers like "yes" or "no" without waiting too long.