Use the Watson Assistant NLP in wingbot chatbot
npm i -S wingbot-watson
const { WatsonNlpModel } = require('wingbot-watson');
const { ai } = require('wingbot');
const watsonNlpModel = new WatsonNlpModel({
username: '<your API username>',
password: '<your API password>',
workspaceId: '<your workspace id>',
serviceUrl: WatsonNlpModel.SERVICE_URL_FRANKFURT // WatsonNlpModel.SERVICE_URL_LONDON
});
ai.register(watsonNlpModel);- WatsonNlpModel
AI Plugin Model
AI Plugin Model
Kind: global class
- WatsonNlpModel
- new WatsonNlpModel(options, [log])
- .SERVICE_URL_DALLAS :
string - .SERVICE_URL_FRANKFURT :
string - .SERVICE_URL_LONDON :
string
| Param | Type | Description |
|---|---|---|
| options | object |
|
| options.username | string |
the API username |
| options.password | string |
the API password |
| options.workspaceId | string |
workspace ID |
| [options.cacheSize] | number |
|
| [options.serviceUrl] | string |
model url, default Dallas |
| [log] | Object |
logging function |
Kind: static property of WatsonNlpModel
Kind: static property of WatsonNlpModel
Kind: static property of WatsonNlpModel
Kind: global typedef
| Param | Type |
|---|---|
| entity | string |
| value | string |
| score | number |
Kind: global typedef
| Param | Type |
|---|---|
| intent | string |
| score | number |
| [entities] | Array.<Entity> |
Kind: global typedef
| Param | Type |
|---|---|
| entities | Array.<Entity> |
| intents | Array.<Intent> |