Skip to main content

Creating Trackers with Streaming API


In Beta

This feature is in Beta. If you have questions or comments, email support@symbl.ai.

You can create and consume Trackers in real-time using the Streaming API.

This document describes how to pass Trackers in the config object of the startRealtimeRequest in the Symbl JavaScript SDK. This example also shows how to consume the results of the detected Trackers in real-time.

Creating Trackers with Management API

While you can create Trackers with Async or Streaming APIs, Symbl recommends creating Trackers using the Management API. Trackers created using the Management APIs are saved and can be reused while the same is not possible with Async or Streaming APIs.

Before creating the Trackers, go through the Best Practices document to learn about the dos and don'ts of the Tracker vocabulary creation.


const connection = await sdk.startRealtimeRequest({
id,
insightTypes: ['action_item', 'question'],
trackers: [
{
name: "COVID-19",
vocabulary: [
"social distancing",
"cover your face with mask",
"vaccination"
]
}
],
config: {
meetingTitle: "My Awesome Meeting",
confidenceThreshold: 0.7,
languageCode: "en-US",
sampleRateHertz: 48000,
trackers: {
"interimResults": true,
"enableAllTrackers": true
}
},
speaker: {
// Optional, if not specified, will simply not send an email in the end.
userId: "john@example.com", // Update with valid email
name: "John",
},
handlers: {
onTrackerResponse: (data) => {
// When a tracker is detected in real-time
console.log('onTrackerResponse', JSON.stringify(data, null, 2));
if (!!data) {
data.forEach((tracker) => {
console.log(`Detected Tracker Name: ${tracker.name}`);
console.log(`Detected Matches`);
tracker.matches.forEach((match) => {
console.log(`Tracker Value: ${match.value}`);
console.log(`Messages detected against this Tracker`);
match.messageRefs.forEach((messageRef) => {
console.log(`Message ID: ${messageRef.id}`);
console.log(`Message text for which the match was detected: ${messageRef.text}`);
console.log(`\n`);
});
console.log(`\n\n`);

console.log(`Insights detected against this Tracker`);
match.messageRefs.forEach((insightRef) => {
console.log(`Insight ID: ${insightRef.id}`);
console.log(`Insight text for which the match was detected: ${insightRef.text}`);
console.log(`Insight Type: ${insightRef.type}`);
console.log(`\n`);
});
console.log(`\n\n`);
});
});
}
},
},
})

Parameter Description

Let’s go over all the parameters passed in the configuration object in the above function:

FieldRequired
idA unique UUID that represents this WebSocket API Session.
insightTypesThe types of Insights to be detected for this Conversation.
trackersThe Trackers to be detected in real-time for that Conversation. Follows the same structure as described in the Trackers section.
configThe config object encapsulates the metadata for the WebSocket API’s session.
meetingTitleThe title for this conversation/meeting.
confidenceThresholdThe insights having confidence scores greater than this threshold will be the ones detected for the Conversation.
languageCodeThe language-code in BCP-47 format.
sampleRateHertzThe sample-rate of the incoming audio data which is being pushed to Symbl.
trackers.interimResultsThe interimResults flag tells Symbl to send the tracker results as soon as they are detected. If false, the tracker results are detected for the finalized transcription responses.
trackers.enableAllTrackersThe enableAllTrackers parameter must be sent to detect all the Trackers. The purpose of this flag is to enable detection of all the Trackers created with the Management API that maintains your entities with Symbl at the account level.
speakerThe details of the speaker in this Conversation
userIdUnique identifier to represent the User.
nameThe name of the User.
handlersThe object encapsulating the call-back functions to be invoked on detection of those specific entities. For more information on various such handlers, check out this link.
onTrackerResponseThis function is invoked when Symbl detects a Tracker in real-time. The structure of the Tracker object is shown in the above code snippet.

Read more