AvatarState
Avatar state object that describes a state and implements the logic of transitions and reactions.
Props
beforeExit: (event: AvatarStateChangeEvent) => void,Promise<void>
Callback function when the dialogue leaves the state
name: string
State name
onEnter: (event: AvatarStateChangeEvent) => AvatarResponse,Promise<AvatarResponse>
Callback function when the dialogue enters the state
onTimeout: (event: AvatarTimeoutEvent) => AvatarResponse,Promise<AvatarResponse>
Callback function when a timeout VoiceAvatarConfig.defaultListenTimeout or AvatarResponseParameters.listenTimeout for a user input is reached.
NOTE: this is a required callback, if you do not specify it you get an error when a timeout occurs
onUtterance: (event: AvatarUtteranceEvent) => AvatarResponse,Promise<AvatarResponse>
Triggered when the dialogue is in this state and a customer says a phrase
utteranceCounter: number
Number of user phrases processed in this state. This counter resets when changing the state to any other (or the same) one
visitsCounter: number
Number of the state visits