Getting Started
Start using the Vatis Streams API for real-time processing
Examples
Visit our GitHub samples repository for more examples on how to use the Vatis Streams API.
Prerequisites
Create the WebSocket connection
Connect to the Vatis Streams API using the WebSocket protocol. We can configure the stream by using either query parameters of a configuration message.
Specify all the configuration parameters in the query string of the WebSocket URL. (e.g. language
)
Send your data
Send your data to the WebSocket server as binary chunks from your data source.
Receive the results
The first result message you’ll receive is the stream metadata message that will contain all the metadata of the created stream.
The rest of the response stream will consist of either response messages or binary message, if configured so.
If an error is encountered during the processing, an error message will be sent, then the connection will be closed.
Analyzing the result
The response messages will contain a sink message that wraps a processor message. The complete list of processor messages can be found in the API reference.
Let’s take for this example the transcription message that contains the transcription of the audio data.
The RESPONSE
type of the message.
The corresponding stream id that emitted this message.
The type of the frame. Can be final
or partial
. A final
frame represents the final processing result for a portion of the stream.
The schema of the payload.
The actual payload of type TranscriptionResponseDto.
The transcription preview.
Close the connection
To confirm the input data was sent completely, send an end-of-stream message to the WebSocket server. The engine will finish processing, send the final results, followed by a similar end-of-stream message, and then close the connection.
Further reading
Explore the complete WS Gateway API reference and the WebSocket integration.