Introducing the IBM Watson SDK for Ruby

Mamoon Raja
IBM watsonx Assistant
2 min readOct 5, 2018

Today, I’d like to introduce to you the new Watson Ruby SDK: an API wrapper to make developing with Watson in Ruby as easy as possible. To help demonstrate this, let’s go through an example scenario.

You have a large body of text that you want to extract emotional insights from. What can you do? Use the Watson Natural Language Understanding service. Simply call the analyze endpoint:

One endpoint, a pair of authentication credentials, and you’ve got the emotional insights on your data.

But now you want to add more Watson services. How do you handle the following issues for different services and endpoints:

  • Network requests
  • Authentication
  • Authorization
  • Error handling
  • Creating, updating, reading, deleting metadata, and more.

You might feel like Michael from The Office at this point. Don’t worry, we have you covered. We’ve just released the IBM Watson SDK for Ruby. The SDK is available as a Ruby gem under the name ibm_watson.

With the Watson Ruby SDK, you can implement advanced features and deliver business requirements instead of worrying about wrapping all the API calls for Watson services. You can still check out the underlying API mechanics and see how the SDK implemented them if you want to learn more about Watson APIs. The Ruby SDK provides you with an option to easily integrate Watson into your Ruby applications.

Let’s use the Ruby SDK for the first issue, Network requests:

As you can see, the Ruby SDK handles the underlying calls and makes things easier.

The SDK is open source and the README includes instructions to get you started. We’ve also included examples for specific Watson services in the repo. Give the Ruby SDK a try and let us know how it works for you.

--

--