IBM Watson

Create an IBM Watson Project

Let's set up a sandbox project with IBM Watson:

Then access it here:

Now we are at our created project!


Get Watson Project API Key

From our Access tokens page, click "New access token" to get our API key:

Now we should have an API Key!


Get IBM IAM token

With our API Key, we can generate an IAM token using this curl request:

curl -X POST 'https://iam.cloud.ibm.com/identity/token' -H 'Content-Type: application/x-www-form-urlencoded' -d 'grant_type=urn:ibm:params:oauth:grant-type:apikey&apikey=MY_APIKEY'

More details on generating an IBM Cloud IAM token here!

Get IBM request url

Now from your projects dashboard, you should see a "View Code" button in the top right:

If you click on the "View Code" button, you will get a curl request:

From this curl request, save the request url located at the start (https://...)

Create Patronus Project

Now to integrate Watson onto our Patronus account, first go to the "Evaluation Runs" page and click the button "Create a New Project" in the top right corner:

Integrate IBM Watson

After creating your project, click "Create a New Run" from the project page:

On the "Model Selection" page, click "Add Custom Model" on the right:

To complete the integration, fill out the Integration name, Request URL, Headers, Request Body, & Response mapping using the Request URL & IAM token from before. (The IBM_PROJECT_ID value in the Request Body can be found on your IBM Project dashboard):

Now to handle passing the IAM token, scroll all the way to the bottom and click the "Add Secret" button. (The secret key name is up to you, but for this guide you can use TOKEN):

After creating your secret key, update the value to the "Authorization" key accordingly (2 double curly braces handle secret values):

To complete the integration, scroll to the very bottom and click the button "Add Custom Model" in the bottom right corner:

Now we have our IBM Watson integration in our Patronus account under custom models!