Rate this page:

AvatarState

Avatar state object that describes a state and implements the logic of transitions and reactions.

Props

beforeExit
Optional
Copy URL
beforeExit: 

(event: AvatarStateChangeEvent) => void,Promise<void>

Callback function when the dialogue leaves the state

name
Copy URL
name: 

string

State name

onEnter
Optional
Copy URL
onEnter: 

(event: AvatarStateChangeEvent) => AvatarResponse,Promise<AvatarResponse>

Callback function when the dialogue enters the state

onTimeout
Copy URL
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
Copy URL
onUtterance: 

(event: AvatarUtteranceEvent) => AvatarResponse,Promise<AvatarResponse>

Triggered when the dialogue is in this state and a customer says a phrase

utteranceCounter
Copy URL
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
Copy URL
visitsCounter: 

number

Number of the state visits

Rate this page: