The Event object defines the words and phrases the Telefol system will recognize and the conditions in which the system will trigger a response. Those conditions may be as simple as any time a given word is said, or complex queries based on the timing of a phrase or its proximity to other phrases. An Event may also be triggered if a phrase is not detected in a given time range.
One or more pairs of phrase and confidence
The event type determines the conditions under which an event will be triggered for the specified phrases.
Appear - phrase(s) can occur anywhere within the audio
Not - phrase(s) do not occur anywhere within the audio
Optional parameter:
First - phrase(s) occur within length seconds of the beginning of the audio
Required parameter:
Bounds - phrase(s) occur within a specified range of the audio
Required Parameters:
Within - specified phrases occur within a certain number of seconds of each other. Requires that at least 2 distinct phrases are specified.
Required Parameter:
Not_within - phrases do not occur within length seconds of each other
Required Parameter:
Note that for most events all will trigger in fewer cases than any, but for not and not_within events, the reverse is true. For example, “Not, Any, apple, banana” is equivalent to “match audio that contains neither apple nor banana” (i.e. NOT(A OR B) ) so the sentence “I want to eat an apple” will not match.
“Not, All, apple, banana” is equivalent to “match audio that does not include apple and banana” (i.e. NOT(A AND B) ) so the sentence “I want to eat an apple” will match.
Phrase or phrases must appear at least this many times before the event is triggered. Once count is exceeded, each successive matching phrase will trigger another event.
For example, “Appear, Any, apple, banana, carrot, count=3” will trigger 6 times on the utterance “apple, apple, carrot, banana, banana, carrot, apple, apple”–first on “carrot” since that’s when there have first been 3 matching phrases, then again on each subsequent matching word. “Appear, All, apple, banana, carrot, count=2” will trigger only once after it gets to the last “carrot” since that’s when it first has seen all of the phrases at least 2 times each. It does not trigger again for the final “apples” because it has not seen all the matching phrases again.
If specified, after an event has been triggered, don’t trigger another event for the same call until this many seconds have passed.
If specified, stop triggering events on any given call after this many have already been triggered.
Allows filtering based on arbitrary data associated with an audio stream. See the API documentation for details.
{
name: "Missing Greeting",
description: "Agent does not start the call with thank you for calling",
evaluate_on: "connect",
participant: "agent",
detection_language: "en_US",
phrase_config:
{
find_notification: "any",
appearance:
{
type: "not",
length: 10
},
phrases:
[
{
phrase: "thank you for calling",
confidence: 800
},
{
phrase: "thanks for calling",
confidence: 800
}
]
}
}
{
name: "Escalation",
description: "Customer makes multiple requests to speak with the agent's superior",
evaluate_on: "connect",
participant: "client",
detection_language: "en_US",
phrase_config:
{
find_notification: "any",
appearance:
{
type: "appear"
},
phrases:
[
{
phrase: "your manager",
confidence: 800
},
{
phrase: "your supervisor",
confidence: 800
}
]
},
count: 2
}
Since there might be multiple ways in which someone might say it–e.g. “Do you guarantee I’ll get my money back?” or “we’ll return your money, guaranteed”–just look for the key words “money” and “guarantee” within 10 seconds of each other. The event will trigger regardless of the order in which the phrases are said.
{
name: "Guarantee",
description: "Either party says money and guarantee close together",
evaluate_on: "connect",
participant: "both",
detection_language: "en_US",
phrase_config:
{
find_notification: "all",
appearance:
{
type: "within",
length: 10
},
phrases:
[
{
phrase: "money",
confidence: 800
},
{
phrase: "guarantee",
confidence: 800
}
]
}
}