Name

global.IBMWatsonNLUService

Description

Interacts with the IBM Watson NLU Server.

Script

var IBMWatsonNLUService = Class.create();
IBMWatsonNLUService.prototype = Object.extendsObject(global.HttpNLUService, {
  initialize: function() {
  	HttpNLUService.prototype.initialize.call(this);
  	this._userId = gs.getProperty('com.glide.nlu.ibmwatson.intent.discovery.user_id', gs.getUserName());
  },

  preparePredictRequestBody: function(utterance) {
  	return JSON.stringify(
  		{
  			"context": {
  				"metadata": {
  					"user_id": this._userId
  				}
  			},
  			"input": {
  				"text": utterance
  			}
  		});
  },

  type: 'IBMWatsonNLUService'
});

Sys ID

7118493a3b33230074bc456993efc464

Offical Documentation

Official Docs: