SIGN UP
Navigation

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.

  • DialogflowInstance
    This class represents an instance of the Dialogflow instance.
  • DialogflowQueryParameters
    Represents the parameters of the conversational query. All the parameters are optional.
  • DialogflowResponse
    Represents Dialogflow intent response.
  • DialogflowResult
    Represents the result of an intent response.
  • DialogflowSettings
    Settings for setup a new Dialogflow instance
  • DialogflowStreamingRecognitionResult
    Contains a speech recognition result corresponding to a portion of the audio that is currently being processed or an indication that this is the end of the single requested utterance.
  • DialogflowEventInput
    Events allow for matching intents by event name instead of the natural language input. For instance, input `` can trigger a personalized welcome response. The parameter name may be used by the agent in the response: `“Hello #welcome_event.name! What can I do for you today?”.`
  • DialogflowQueryInput
    Represents the query input. It can contain either: 1. A conversational query in the form of text 2. An event that specifies which intent to trigger
  • DialogflowTextInput
    Represents the natural language text to be processed.
  • createDialogflow
    Creates and returns a new Dialogflow instance which provides the data exchanging with the Dialogflow API, handling events etc.
  • detectVoicemail
    Start voicemail recognition session. You can check how many times voicemail was detected in the [Call history](http://manage.voximplant.com/#callhistory).
  • Events
  • DialogflowLanguage

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!"));
   });