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

Triggers when an error occurs.

Parameters

  • reason:

    string

    Error description

Finish

Copy URL

Triggers when an avatar ends a conversation with a user.

Parameters

  • customData:

    Object

    Optional

    Additional data returned from an avatar

  • utterance:

    string

    Optional

    Phrase to reply to the user with

Loaded

Copy URL

Triggers when an avatar script is loaded and ready to be used.

Reply

Copy URL

Triggers when an avatar is ready to reply to a user.

Parameters

  • currentState:

    string

    Optional

    Current avatar state.

  • customData:

    Object

    Optional

    Additional data returned from an avatar

  • interruptableAfter:

    number

    Optional

    Time after which an avatar is ready to handle user interruptions (in case the avatar voices its response)

  • isFinal:

    false

    Optional

    Boolean value that specifies 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 boolean value that specifies whether an avatar listens to the user after saying its line (or during it, if interruptions are enabled)

  • listenTimeout:

    number

    Optional

    Optional number value that specifies how long an avatar will listen to the user after saying its line (or during it, if interruptions are enabled)

  • nextState:

    string

    Optional

    Next avatar state. Optional value

  • utterance:

    string

    Optional

    Phrase to reply to the user with

UtteranceParsed

Copy URL

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

Parameters

  • confidence:

    number

    Optional

    Recognized phrase confidence

  • currentState:

    string

    Optional

    Current avatar state.

  • entities:

    Object

    Extracted entities (both system and custom) AvatarEntities

  • intent:

    string

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

  • intents:

    Object[]

    Optional

    Extended information on 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