pub struct AssistantCustomEndpointingRule {
pub type: TypeTrue,
pub regex: String,
pub regex_options: Option<Vec<RegexOption>>,
pub timeout_seconds: f64,
}
Fields§
§type: TypeTrue
This endpointing rule is based on the last assistant message before customer started speaking. Flow: - Assistant speaks - Customer starts speaking - Customer transcription comes in - This rule is evaluated on the last assistant message - If a match is found based on regex
, the endpointing timeout is set to timeoutSeconds
Usage: - If you have yes/no questions in your use case like "are you interested in a loan?", you can set a shorter timeout. - If you have questions where the customer may pause to look up information like "what’s my account number?", you can set a longer timeout.
regex: String
This is the regex pattern to match. Note: - This works by using the RegExp.test
method in Node.JS. Eg. /hello/.test(\"hello there\")
will return true
. Hot tip: - In JavaScript, escape \\
when sending the regex pattern. Eg. \"hello\\sthere\"
will be sent over the wire as \"hellosthere\"
. Send \"hello\\\\sthere\"
instead. - RegExp.test
does substring matching, so /cat/.test(\"I love cats\")
will return true
. To do full string matching, send "^cat$".
regex_options: Option<Vec<RegexOption>>
These are the options for the regex match. Defaults to all disabled. @default []
timeout_seconds: f64
This is the endpointing timeout in seconds, if the rule is matched.
Implementations§
Trait Implementations§
Source§impl Clone for AssistantCustomEndpointingRule
impl Clone for AssistantCustomEndpointingRule
Source§fn clone(&self) -> AssistantCustomEndpointingRule
fn clone(&self) -> AssistantCustomEndpointingRule
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Default for AssistantCustomEndpointingRule
impl Default for AssistantCustomEndpointingRule
Source§fn default() -> AssistantCustomEndpointingRule
fn default() -> AssistantCustomEndpointingRule
Source§impl<'de> Deserialize<'de> for AssistantCustomEndpointingRule
impl<'de> Deserialize<'de> for AssistantCustomEndpointingRule
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for AssistantCustomEndpointingRule
impl PartialEq for AssistantCustomEndpointingRule
Source§fn eq(&self, other: &AssistantCustomEndpointingRule) -> bool
fn eq(&self, other: &AssistantCustomEndpointingRule) -> bool
self
and other
values to be equal, and is used by ==
.