{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "#/components/schemas/AssistantCustomEndpointingRule", "title": "AssistantCustomEndpointingRule", "type": "object", "properties": { "type": { "type": "string", "description": "This endpointing rule is based on the last assistant message before customer started speaking.\n\nFlow:\n- Assistant speaks\n- Customer starts speaking\n- Customer transcription comes in\n- This rule is evaluated on the last assistant message\n- If a match is found based on `regex`, the endpointing timeout is set to `timeoutSeconds`\n\nUsage:\n- If you have yes/no questions in your use case like \"are you interested in a loan?\", you can set a shorter timeout.\n- 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.", "enum": [ "assistant" ] }, "regex": { "type": "string", "description": "This is the regex pattern to match.\n\nNote:\n- This works by using the `RegExp.test` method in Node.JS. Eg. `/hello/.test(\"hello there\")` will return `true`.\n\nHot tip:\n- In JavaScript, escape `\\` when sending the regex pattern. Eg. `\"hello\\sthere\"` will be sent over the wire as `\"hellosthere\"`. Send `\"hello\\\\sthere\"` instead.\n- `RegExp.test` does substring matching, so `/cat/.test(\"I love cats\")` will return `true`. To do full string matching, send \"^cat$\"." }, "regexOptions": { "description": "These are the options for the regex match. Defaults to all disabled.\n\n@default []", "type": "array", "items": { "$ref": "#/components/schemas/RegexOption" } }, "timeoutSeconds": { "type": "number", "description": "This is the endpointing timeout in seconds, if the rule is matched.", "minimum": 0, "maximum": 15 } }, "required": [ "type", "regex", "timeoutSeconds" ] }