SIGN UP

AI

The AI module provides additional methods that using Artificial Intelligence. These methods allow to solving business tasks in more productive way.

Add the following line to your scenario code to use the module:

 require(Modules.AI);

All functions, events and classes of the module can be used only after this line.

functions

createDialogflow(params: DialogflowSettings): DialogflowInstance

Creates and returns a new Dialogflow instance which provides the data exchanging with the Dialogflow API, handling events etc.

Parameters

Returns

detectVoicemail(call: Call): Promise

Start voicemail recognition session. You can check how many times voicemail was detected in the Call history.

Parameters

Returns

  • Return:

    Promise

Examples

request:

 // Using with the event-based API
 call.addEventListener(CallEvents.AudioStarted, e => AI.detectVoicemail(call).catch(()=>{}));
 call.addEventListener(AI.Events.VoicemailDetected, e => Logger.write(`Voicemail detected (${e.confidence}%)`));
 call.addEventListener(AI.Events.VoicemailNotDetected, e => Logger.write("Voicemail not detected!"));

 // Using with the promise-based API
 call.addEventListener(CallEvents.AudioStarted, e => {
       AI.detectVoicemail(call)
           .then(e => Logger.write(`Voicemail detected (${e.confidence}%)`))
           .catch(e => Logger.write("Voicemail not detected!"));
   });