Events
Add the following line to your scenario code to use the events:
require(Modules.AI);
Constants
DialogflowError
Event is triggered when a Dialogflow instance causes error.
Parameters
cause:
string
The cause of the event
dialogflow:
Link to the Dialogflow instance
DialogflowPlaybackFinished
The event is triggered when a playback of a single phrase has finished successfully or in case of playback error.
Parameters
dialogflow:
Link to the Dialogflow instance
error:
undefined
Optional
DialogflowPlaybackMarkerReached
The event is triggered when DialogflowInstance.addMarker is reached.
Parameters
dialogflow:
Link to the Dialogflow instance
offset:
number
Marker offset
DialogflowPlaybackStarted
The event is triggered when a playback of a single phrase has started.
Parameters
dialogflow:
Link to the Dialogflow instance
duration:
number
Playback duration
DialogflowQueryResult
Event is triggered when a Dialogflow instance returns a query result.
Parameters
dialogflow:
Link to the Dialogflow instance
result:
The results of the conversational query or event processing
DialogflowRecognitionResult
Event is triggered when a Dialogflow instance returns a recognition result.
Parameters
dialogflow:
Link to the Dialogflow instance
isFinal:
boolean
The default of 0.0 is a sentinel value indicating confidence was not set. If it's false, the StreamingRecognitionResult represents an interim result that may change. If it's true, the recognizer will not return any further hypotheses about this piece of the audio.
DialogflowResponse
Event is triggered when a Dialogflow instance returns an intent response.
Parameters
dialogflow:
Link to the Dialogflow instance
response:
The intent response
DialogflowStopped
Event is triggered when a Dialogflow instance was stopped.
Parameters
cause:
string
The cause of the event
dialogflow:
Link to the Dialogflow instance
VoicemailDetected
Event is triggered when an answering machine or voicemail is detected.
Parameters
call:
Call that triggered the event
confidence:
number
Recognition confidence. Values range from 0 (completely uncertain) to 100 (completely certain). The value is not guaranteed to be accurate, consider it while handling the event.
VoicemailNotDetected
Event is triggered when an answering machine or voicemail is not detected.
Parameters
call:
Call that triggered the event