I am happy to announce that we have released v0.1.0 of the Symbl.ai Go SDK to the community for an initial evaluation! This marks an interesting turn in how developers and users of the Symbl.ai platform can interact with the APIs to derive all their conversation insights.

The initial release has a significant amount of the API implemented, but still has some work left to round out all of the functionality the Symbl platform offers. Because this is an initial release, I would very much call this release a beta. Much of the functionality is useful to enable developers to hit the ground running, but I would only use this API in non-production workloads in an evaluation mode until we get more insights from the community and harden the SDK to be more robust.

This blog post will cover the Async APIs that are available in the SDK and will highlight some of the important functionality provided. Even though the Streaming API portion of the SDK is implemented in the v0.1.0 release, I didn’t think it would make sense to cram both topics into a single blog post. You can expect to see a second blog post that will cover the streaming portion of the SDK shortly.

Why a Go SDK?

The first question you might ask yourself is why create a Go SDK for the Symbl.ai platform? It is true that the majority of the SDKs available target web or mobile platform integrations, but those SDKs all have one singular thing in common: They are traditionally used to process conversations on the client side.

You might point out that a python SDK exists to help non-client side conversations, and you would be absolutely correct. However, providing a Go binding enables several important use cases, which include: edge devices on memory-constrained platforms, headless devices (i.e., those devices without a Graphical User Interface), and—probably the most important reason—for the first time introduces the ability to processing conversations on a backend server-type component that can scale out in an enterprise application.

That last use case is the most important one and will transform the conversation and voice industry. This SDK ultimately is looking to solve being able to take our conversations that are happening on CPaaS platforms (Zoom, Google Meet, etc.) in isolation and aggregate them to unlock more contextual understanding for an ecosystem as a whole.

What do I mean by “in isolation?” If you think about how we add capabilities to understand conversations, we always look at these conversations in discrete, isolated instances or buckets; think of a single Zoom meeting, a tech support call between a customer and support, and the like.

When we start to unlock the context of conversations and break down those walls so that we can make associations between the context in one Zoom meeting with the context in a Google Meet or even a customer support call, that is when you are going to see real mind-blowing advancements.

A demonstration of this style of enterprise application will be coming in the near future. Until then, let’s take a look at the Go SDK’s Async API.

Let’s Dive Into the Async API

Contained within the repo, there are several examples which include posting a file to the Symbl.ai platform, referencing a URL to feed in, managing trackers, etc. Let’s look at the basics of obtaining Topics from posting an audio file to the Symbl.ai platform.

The first thing you need to do before calling any Symbl.ai API is to login to the platform. If you don’t have a free Symbl.ai account, you can sign up here (again, for free) without having to provide a credit card.

Next, you must add your APP_ID and APP_SECRET to your environment variables. We use environment variables since they are easy to configure, support PaaS style deployments, and work very well in containerized environments such as Docker and Kubernetes.

export APP_ID=YOUR-APP-ID-HERE
export APP_SECRET=YOUR-APP-SECRET-HERE

Then, log into the platform and take the restClient object and effectively cast or transform the client into an asyncClient that can access the async APIs.

ctx := context.Background()
 
restClient, err := symbl.NewRestClient(ctx)
if err == nil {
   fmt.Println("Succeeded!\n\n")
} else {
   fmt.Printf("New failed. Err: %v\n", err)
   os.Exit(1)
}
 
asyncClient := async.New(restClient)

The next thing we want to do is POST the .mp3 file to the Symbl platform and wait for the platform to process the audio file.

completed, err := asyncClient.WaitForJobComplete(ctx, interfaces.WaitForJobStatusOpts{JobId: jobConvo.JobID})
if err != nil {
   fmt.Printf("WaitForJobComplete failed. Err: %v\n", err)
   os.Exit(1)
}
if !completed {
   fmt.Printf("WaitForJobComplete failed to complete. Use larger timeout\n")
   os.Exit(1)
}

Finally, to obtain insights about Topics contained within the audio file, you can simply call GetTopics.

topicsResult, err := asyncClient.GetTopics(ctx, jobConvo.ConversationID)
if err != nil {
   fmt.Printf("Topics failed. Err: %v\n", err)
   os.Exit(1)
}
 
fmt.Printf("\n\n")
spew.Dump(topicsResult)

If you are interested in action items, questions, or another Async API call, you simply need to swap out the last GetTopics call with another call in the SDK. Pretty simple!

What’s Next?

Part 2 in this series will cover the Streaming API, how to use WebSockets in this Go SDK in an easy-to-consume way, how to use some helper libraries to build local applications in a snap, and more importantly, discuss why real-time streaming in this Go SDK is revolutionary.

Until then, check out the Symbl-Go-SDK, provide feedback, file issues that you encounter when using the SDK, and take this SDK and apply them to these new and interesting use cases that are now unlocked.

David vonThenen
David vonThenen
Developer Advocate

David is a self-described Tech geek and Developer Advocate enabling others to process communications to derive conversation intelligence. David talks Kubernetes/containers, VMware virtualization, backup recovery/replication solutions, adaptors in hardware storage connectivity, and everything else that is tech!