SessionEvents
What session.on(name, fn) delivers.
Properties
Section titled “Properties”ended:
object
The session is over. Fires once. reason is one of client_ended, partner_ended, max_duration,
idle_timeout, disconnected, server_shutdown, provider_failure, suspended, service_stopped (the voice
service was switched off; start a new session once it is back) or error.
durationMs
Section titled “durationMs”durationMs:
number
reason
Section titled “reason”reason:
string
turns:
number
error:
SessionErrorInfo
A problem. fatal: false means the session goes on (for example audio_unavailable).
event:
ServerEvent
Every event from the service, as parsed, for logging or for events the SDK doesn’t map.
interrupted
Section titled “interrupted”interrupted:
object
The reply was cut off (the person spoke, or interrupt() was called). heardMs is how much was heard.
heardMs
Section titled “heardMs”heardMs:
number
replyId
Section titled “replyId”replyId:
string
replySentence
Section titled “replySentence”replySentence:
object
One sentence of the voice’s reply, with its emotion, as it is spoken.
emotion
Section titled “emotion”emotion:
string
index:
number
replyId
Section titled “replyId”replyId:
string
text:
string
safety
Section titled “safety”safety:
object
The safety layer acted on a turn: the stage, the category (a level, never the text) and the action taken.
action
Section titled “action”action:
string
category
Section titled “category”category:
string
stage:
string
turn:
number
state:
SessionState
The session’s state changed.
transcript
Section titled “transcript”transcript:
object
What the person said, once the service has understood the turn. languageStage is the language’s stage; languageBeta is true for any
language that is not supported (beta or alpha).
language
Section titled “language”language:
string
languageBeta
Section titled “languageBeta”languageBeta:
boolean
languageStage
Section titled “languageStage”languageStage:
LanguageStage
text:
string
turn:
number
warning
Section titled “warning”warning:
object
A heads-up before the session ends, for example secondsLeft before the time limit.
code:
string
secondsLeft
Section titled “secondsLeft”secondsLeft:
number