Init
Request
InputAudioStreamOpen
InputAudioStreamClose
InputAudioStreamCancel
Ready
Response
Recognized
SessionStarted
SessionEnded
Closed
immediately after startOpen
when web socket connection established to the serverBotEvent.Init
containing app key, sender identification and client requirements in object of type BotClientRequirementsBotEvent.Ready
otherwise BotEvent.Error
BotEvent.Ready
> going to state Sleeping
BotEvent.Error
> showing error message text and going to state Failed
Sleeping
after start, it will be waiting for user input (pushing device button or keyboard ENTER key) OR (if auto start config param is set) will send event BotEvent.Request
containing request object of class Request with user input.transcript = "#intro"
BotEvent.SessionStarted
event containing valid conversation sessionId to the client. This feature will allow to transfer user session from one client to another in the future (e.g. to go from hardware device to mobile and back)BotEvent.SessionStarted
containing accepted or different sessionId
which will be used for conversation session identification; afterwards starts with processing request and sending BotEvent.Response
containing response object of class ResponseBotEvent.Request
containing request object of class Request with user input.transcript = "user text input"
BotEvent.Response
events going to the state Responding
- depending on client configuration, response text can be shown, audio (speech synthesis or another audio track specified in response) can be played and/or image/video can be shown from URL(s) specified in response. When output is finished, clients goes to state Listening
BotEvent.Response
when client is Sleeping
to initiate conversation triggered by external circumstances (e.g. certain scheduled time, web hook etc.)BotEvent.InputAudioStreamOpen
BotEvent.InputAudioStreamOpen
eventBotEvent.Recognized
event containing text transcript to the client and starts processing itBotEvent.Recognized
optionally showing text transcript to the user, going to state Processing. It also sends event BotEvent.InputAudioStreamClose to notify server that audio input has been closed on client sideOpen
state, so it can initiate it for future communication by Init
event containing config parameters describing how STT (Speech-To-Text) and STT (Text-To-Speech) will be treated.Ready
event, client goes to Sleeping
stateRequest
event containing #intro
actionsessionId
so it can attach to existing / previous session.deviceId
should be unique per hardware + software client combination (e.g. browser type with unique ID stored in local storage for web application, application ID + mobile phone ID for mobile clients, client software name combined with MAC address for standalone client appliances etc.)Response
event and client goes to Responding
state, playing output audioInputAudioStreamOpen
eventInputAudioStreamOpen
event in return. Client goes to Listening
state and starts to send binary audio packets to the sockets.Recognized
event (so it can display input transcript to the user), client goes to Processing
stateResponse
event, client goes to Responding
state, plays response audio (and optionally also displays response text)sessionEnded
is set true
, client goes do Sleeping
mode and sessionId
value is discarded (e.g. set to null
) so new value will have to be created for new conversation. If sleepTimeout
is non zero, then client also goes to Sleeping
mode but keeps sessionId
until sleep timeout expires. This allows to get back into the same session and have multiple conversations in the same session context.