Rate this page:

Events

Avatar events.
Add the following line to your scenario code to use the events:

require(Modules.Avatar);

Constants

Error

Copy URL

Triggered when an error occurs.

Parameters

  • avatar:

    Avatar

  • reason:

    string

    Error description.

Finish

Copy URL

Triggered when an avatar ends a conversation with a customer.

Parameters

Loaded

Copy URL

Triggered when an avatar script is loaded and ready to use.

Parameters

Reply

Copy URL

Triggered when an avatar is ready to reply to a customer.

Parameters

  • avatar:

    Avatar

  • channelParameters:

    ChannelParameters

    Optional

    Optional. Avatar text and voice ChannelParameters.

  • currentState:

    string

    Current avatar state.

  • customData:

    Object

    Optional

    Optional. Additional data returned from an avatar. Can be passed via the AvatarResponseParameters.customData parameter.

  • interruptableAfter:

    number

    Optional

    Optional. Time after which an avatar is ready to handle customer's interruptions (in case the avatar voices its response).

  • isFinal:

    false

    Optional

    Optional. Whether an avatar's reply is final. If true, all other parameters except customData are ignored and the avatar does not process any more inputs in the current conversation.

  • listen:

    true

    Optional

    Optional. Whether an avatar listens to the user after saying its utterance (or during it, if interruptions are enabled).

  • listenTimeout:

    number

    Optional

    Optional. Number value that specifies how long an avatar listens to the user after saying its utterance (or during it, if interruptions are enabled).

  • nextState:

    string

    Optional

    Optional. Next avatar state.

  • utterance:

    string

    Optional

    Optional. Utterance to reply to the customer with.

UtteranceParsed

Copy URL

Triggered when an avatar parses a customer's phrase. The recognized phrase can be used for debugging and logging recognition results if needed.

Parameters

  • avatar:

    Avatar

  • confidence:

    number

    Optional

    Optional. Recognized phrase confidence.

  • currentState:

    string

    Current avatar state.

  • entities:

    Object

    Optional

    Optional.Extracted entities (both system and custom) AvatarEntities.

  • intent:

    string

    Most suitable intent recognized for the phrase (or 'unknown' if unclear).

  • intents:

    Object[]

    Optional

    Optional. Extended information of the intent recognition results AvatarUtteranceIntent.

  • response:

    string

    Default response to the intent from the UI.

  • text:

    string

    Recognized phrase text.

  • utteranceCounter:

    number

    Number of user phrases processed in this state.

  • visitsCounter:

    number

    Number of the state visits.