SIGN UP

DialogflowInstance

This class represents an instance of the Dialogflow instance.

Methods

addEventListener

addEventListener(DialogflowEvent: Event, handler: Function): void

Add a handler for specific event generated by the specified Dialogflow instance. Use only functions as handlers; anything except a function leads to the error and scenario termination when a handler will be called.

Parameters

  • DialogflowEvent:

    Event

    The AI.DialogflowError, AI.DialogflowQueryResult or AI.DialogflowRecognitionResult event.

  • handler:

    Function

    Handler function

Returns

  • Return:

    void

addMarker

addMarker(offset: number): void

Add Dialogflow speech synthesis playback marker. The AI.Events.DialogflowPlaybackMarkerReached event will be triggered when the marker is reached. instance.addMarker(1000); instance.addMarker(-2000);

Parameters

  • offset:

    number

    Positive/negative offset (ms) from the start/end of media.

Returns

  • Return:

    void

removeEventListener

removeEventListener(DialogflowEvent: Event, handler: Function): void

Remove the event handler for specific event generated by the specified Dialogflow instance.

Parameters

  • DialogflowEvent:

    Event

    The AI.DialogflowError, AI.DialogflowQueryResult or AI.DialogflowRecognitionResult event.

  • handler:

    Function

    Handler function

Returns

  • Return:

    void

sendQuery

sendQuery(dialogflowQuery: DialogflowQueryInput): void

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

Parameters

Returns

  • Return:

    void

setOutputAudioConfig

setOutputAudioConfig(outputAudioConfig: DialogflowOutputAudioConfig): void

Update audio output parameter

Parameters

Returns

  • Return:

    void

setPhraseHints

setPhraseHints(phraseHints: Object): void

Set the collection of phrase hints for the intents.

Parameters

  • phraseHints:

    Object

    The collection of phrase hints which are used to boost accuracy of speech recognition.

Returns

  • Return:

    void

setQueryParameters

setQueryParameters(queryParameters: Object): void

Set the parameters for the intents.

Parameters

Returns

  • Return:

    void

stop

stop(): void

Stop and destroy current Dialogflow instance

Returns

  • Return:

    void