The Streaming API is based on WebSocket protocol and can be used for real-time use cases where both the audio and its insights need to be available in real-time.
Currently, you can get only Questions and Action Items in real-time with Streaming API for Python SDK. However, you can get Messages, Topics, Action Items, Follow-Ups, Questions, Members and Conversation data using the get Conversation object function.
The Python SDK provides the following capabilities:
The code snippet below allows you to a Streaming API connection with Symbl via WebSocket. This returns a connection object:
|Optional||Don't add this parameter if you have symbl.conf file in your home directory or working directory. Read more about symbl.conf file and using credentials in the Python SDK Configuration section.|
|Optional||Speaker object containing |
|Optional||The insights to be returned in the WebSocket connection. Questions and Action Items are the insights currently supported.|
|Optional||Use this parameter to pass |
To stop an active WebSocket connection, use the code given below:
Once the WebSocket connection is established, you can get live updates on conversation events such as generation of transcript, action items or questions, etc.
connection_object.subscribe is a function of the
connection object that listens to the events of a live call and let's you subscribe to them in real-time. It takes a dictionary parameter, where the key can be an event and its value can be a callback function that should be executed on the occurrence of that event.
Following are the functions for different events you can subscribe to:
|Generates an event whenever transcription is available.|
|It will generate an event for live transcriptions. It will include isFinal property which will be False initially, meaning the transcription is not finalized.|
|Generates an event whenever an |
|Generates an event whenever a topic is identified in any transcription.|
This allows you to send data to WebSocket directly via your mic. It is a recommended function for first time users sending audio to Symbl.
To receive the insights via email, use the code given below:
You can send custom audio data from some other library using the following code.
send_audio function sends audio data to WebSockets in binary format.
Connection object has a conversation parameter through which you can directly query the Conversation API with the provided
The sample code given below shows the usage of subscribe function and other functionalities explained above. You can simply copy-paste this code snippet and run it in your Python editor to
For a complete list of supported classes and objects in the Python SDK, see the Python SDK Reference page.
You can view more capabilities added to the Streaming API in the following sections:
|PortAudio Errors on Mac Systems: If you're getting PortAudio Error, please consider updating the PortAudio library in your system. Running the following command can help. |