Rate this page:

DialogflowInstance

Represents a Dialogflow instance.
Add the following line to your scenario code to use the class:

require(Modules.AI);

Constructors

constructor

Copy URL

Parameters

  • id:

    string

  • parameters:

    Object

    Dialogflow parameters

Methods

addEventListener

Copy URL
addEventListener(event: 

Events

,
callback:

Function

):

void

Adds a handler for the specified AI.Events. Use only functions as handlers; anything except a function leads to the error and scenario termination when a handler is called.

Parameters

Returns

  • type:

    void

addMarker

Copy URL
addMarker(offset: 

number

):

void

Add a Dialogflow speech synthesis playback marker. The AI.Events.DialogflowPlaybackMarkerReached event is triggered when the marker is reached.

Parameters

  • offset:

    number

    Positive/negative offset in milliseconds from the start/end of media

Returns

  • type:

    void

removeEventListener

Copy URL
removeEventListener(event: 

Events

,
callback:

Function

):

void

Removes a handler for the specified AI.Events event.

Parameters

Returns

  • type:

    void

sendMediaTo

Copy URL
sendMediaTo(mediaUnit: 

VoxMediaUnit

,
parameters:

SendMediaParameters

):

void

Starts sending media (voice) from a Dialogflow participant to the media unit.

Parameters

Returns

  • type:

    void

sendQuery

Copy URL
sendQuery(dialogflowQuery: 

DialogflowQueryInput

):

void

Send a query to the DialogFlow instance. You can send either a text string up to 256 characters or an event object with the event name and additional data.

Parameters

Returns

  • type:

    void

setOutputAudioConfig

Copy URL
setOutputAudioConfig(outputAudioConfig: 

DialogflowOutputAudioConfig

):

void

Update the audio output configuration.

Parameters

Returns

  • type:

    void

setPhraseHints

Copy URL
setPhraseHints(phraseHints: 

{[id: string]: string}

):

void

Set a collection of phrase hints for the intents.

Parameters

  • phraseHints:

    {[id: string]: string}

    The collection of phrase hints to boost the speech recognition accuracy

Returns

  • type:

    void

setQueryParameters

Copy URL
setQueryParameters(queryParameters: 

DialogflowQueryParameters

):

void

Set parameters for the intents.

Parameters

Returns

  • type:

    void

stop

Copy URL
stop(): 

void

Stop and destroy the current Dialogflow instance.

Returns

  • type:

    void

stopMediaTo

Copy URL
stopMediaTo(mediaUnit: 

VoxMediaUnit

):

void

Stops sending media (voice) from a Dialogflow participant to the media unit.

Parameters

Returns

  • type:

    void