Events
Avatar events. Add the following line to your scenario code to use the events:
require(Modules.Avatar);
Constants
Error
Triggers when an error occurs.
Parameters
reason:
string
Error description
Finish
Triggers when an avatar ends a conversation with a user.
Parameters
customData:
Object
OptionalAdditional data returned from an avatar
utterance:
string
OptionalPhrase to reply to the user with
Loaded
Triggers when an avatar script is loaded and ready to be used.
Reply
Triggers when an avatar is ready to reply to a user.
Parameters
currentState:
string
OptionalCurrent avatar state.
customData:
Object
OptionalAdditional data returned from an avatar
interruptableAfter:
number
OptionalTime after which an avatar is ready to handle user interruptions (in case the avatar voices its response)
isFinal:
false
OptionalBoolean 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
OptionalOptional boolean value that specifies whether an avatar listens to the user after saying its line (or during it, if interruptions are enabled)
listenTimeout:
number
OptionalOptional 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
OptionalNext avatar state. Optional value
utterance:
string
OptionalPhrase to reply to the user with
UtteranceParsed
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
OptionalRecognized phrase confidence
currentState:
string
OptionalCurrent 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[]
OptionalExtended 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