Soul Machines uses a bi-directional WebSocket connection to send a message back and forth between our servers and your Orchestration Server. Each Each message is JSON encoded and sent as a web socket ‘text’ message over HTTPS. Each Each JSON encoded message includes some standard fields for the kind of message communicated.
There are three kinds of messages: event, request and response. In this documentguide, we only cover the messages relevant to connecting to the NLP platform.
...
Each time a user speaks to a Digital Hero, your STT service transcribes their utterance from audio to text. The The output from your STT service for each utterance is a series of intermediate recognizeResults
messages, as well as one final recognizeResults
message. These These messages are sent from the Soul Machines Servers to your Orchestration Server via the WebSocket connection.
Below is an example of a “final”recognizeResults
message. The The final messages can be identified by those messages where the “final” attribute is set to “true.” The transcript text from each “final”message must be sent to your NLP for a response, all other recognizeResults
messages received (e.g. where “final” = ”false”) can be ignored.
...
Below is an example of startSpeaking
command message.
Code Block | ||
---|---|---|
| ||
{
"category": "scene",
"kind": "request",
"name": "startSpeaking",
"transaction": null | <int>,
"body": {
"personaId": 1,
"text" : ”Yes, I can help you apply for your credit card. Please tell me which type of card you are after, Visa or Mastercard?"
}
} |
The text for the startSpeaking
message comes from your NLP response messages. The format of the NLP response message varies between vendors. Please refer to your NLP vendor documentation for more information.