Events
Avatar events.
Add the following line to your scenario code to use the events:
require(Modules.Avatar);
Constants
Finish
Triggered when an avatar ends a conversation with a customer.
Parameters
avatar:
channelParameters:
ChannelParameters
OptionalAvatar text and voice ChannelParameters
currentState:
string
Current avatar state
customData:
Object
OptionalAdditional data returned from the avatar. Can be passed via the AvatarResponseParameters.customData parameter
utterance:
string
OptionalUtterance to reply to the customer with
Reply
Triggered when an avatar is ready to reply to a customer.
Parameters
avatar:
channelParameters:
ChannelParameters
OptionalAvatar text and voice ChannelParameters
currentState:
string
Current avatar state
customData:
Object
OptionalAdditional data returned from an avatar. Can be passed via the AvatarResponseParameters.customData parameter
interruptableAfter:
number
OptionalTime after which an avatar is ready to handle customer's interruptions (in case the avatar voices its response)
isFinal:
false
OptionalWhether 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. Whether an avatar listens to the user after saying its utterance (or during it, if interruptions are enabled)
listenTimeout:
number
OptionalOptional 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
OptionalNext avatar state. Optional
utterance:
string
OptionalUtterance to reply to the customer with
UtteranceParsed
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:
confidence:
number
OptionalRecognized phrase confidence
currentState:
string
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[]
OptionalExtended 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