AvatarState
Avatar state object that describes a state and implements the logic of transitions and reactions.
Props
beforeExit
beforeExit: (event: AvatarStateChangeEvent) => void,Promise<void>
| undefined
Triggers when the dialogue leaves the state
name
name: string
State name
onEnter
onEnter: (event: AvatarStateChangeEvent) => AvatarResponse,Promise<AvatarResponse>
| undefined
Triggers when the dialogue enters the state
onTimeout
onTimeout: (event: AvatarTimeoutEvent) => AvatarResponse,Promise<AvatarResponse>
| undefined
Triggers when a timeout for a user input occurs. The value is in milliseconds
onUtterance
onUtterance: (event: AvatarUtteranceEvent) => AvatarResponse,Promise<AvatarResponse>
Triggers when the dialogue is in this state and a customer says a phrase
utteranceCounter
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
visitsCounter: number
Number of the state visits