watson-developer-cloud
Advanced tools
Comparing version 2.22.2 to 2.23.0
@@ -16,1 +16,12 @@ <!-- | ||
- [ ] link to public docs when adding new a service or new features for an existing service | ||
##### New version_date Checklist | ||
<!-- These only apply when adding a new version_date to a service - delete this section otherwise --> | ||
- [ ] A new constant is avaliable with the version_date - [example](https://github.com/watson-developer-cloud/node-sdk/blob/d1418ac2f9774194aaff0c8bd80f0d3722beef72/conversation/v1.js#L77) | ||
- [ ] The new constant has a comment that summarizes the changes and/or links to relevant doc pages | ||
- [ ] Any older version_date constants remain intact | ||
- [ ] The error message thrown if the service is created without a version_date indicates the new version_date constant | ||
- [ ] The example in the README includes the new version_date constant | ||
- [ ] Any relevant code in the examples/ folder has been updated to use the new version_date constant | ||
- [ ] Most tests are updated to the new version_date | ||
- [ ] 1-2 new tests are added that use the old version_date (optional, but preferred) |
@@ -0,1 +1,11 @@ | ||
# v2.23.0 | ||
* Added support for Conversation intents and examples | ||
# v2.22.2 | ||
* Speech to Text createRecognitionJob() now accepts all params from .recognize() | ||
* Speech to Text getRecognitionJobs() accepts an optional params object in order to match the signature of the rest of the API | ||
# v2.22.1 | ||
* Make callback_url optional for Speech to Text createRecognitionJob() | ||
# v2.22.0 | ||
@@ -2,0 +12,0 @@ * Speech to Text Asychronous API support |
@@ -181,3 +181,3 @@ /** | ||
* | ||
* @param {Object} params { workspace_id: '', } | ||
* @param {Object} params | ||
* @param params.workspace_id | ||
@@ -386,5 +386,5 @@ * @param [params.input] | ||
* | ||
* @param {Object} params { workspace_id: '', } | ||
* @param params.workspace_id | ||
* @param [params.export=false] - if true, the full contents of all of the sub-resources are returned | ||
* @param {Object} params | ||
* @param {String} params.workspace_id | ||
* @param {Boolean} [params.export=false] - if true, the full contents of all of the sub-resources are returned | ||
* @param {Function} [callback] | ||
@@ -530,3 +530,3 @@ */ | ||
* | ||
* @param {Object} params { workspace_id: '', } | ||
* @param {Object} params | ||
* @param {String} params.workspace_id | ||
@@ -575,3 +575,3 @@ * @param {String} [params.name] | ||
* | ||
* @param {Object} params { workspace_id: '', } | ||
* @param {Object} params | ||
* @param params.workspace_id | ||
@@ -598,2 +598,289 @@ * @param {Function} [callback] | ||
/** | ||
* Method: createIntent | ||
* | ||
* Create a new intent | ||
* | ||
* @param {Object} params | ||
* @param {String} params.workspace_id | ||
* @param {String} [params.intent] | ||
* @param {String} [params.description] | ||
* @param {Array<Object>} [params.examples] | ||
* @param {Function} [callback] | ||
* | ||
*/ | ||
ConversationV1.prototype.createIntent = function(params, callback) { | ||
params = params || {}; | ||
const parameters = { | ||
options: { | ||
url: '/v1/workspaces/{workspace_id}/intents', | ||
method: 'POST', | ||
json: true, | ||
path: pick(params, ['workspace_id']), | ||
body: pick(params, ['intent', 'description', 'examples']) | ||
}, | ||
requiredParams: ['workspace_id', 'intent'], | ||
defaultOptions: this._options | ||
}; | ||
return requestFactory(parameters, callback); | ||
}; | ||
/** | ||
* Method: getIntents | ||
* | ||
* List the intents for a workspace. | ||
* | ||
* @param {Object} params | ||
* @param {String} params.workspace_id | ||
* @param {Boolean} [params.export=false] - if true, the full contents of all of the sub-resources are returned | ||
* @param {Function} [callback] | ||
* | ||
*/ | ||
ConversationV1.prototype.getIntents = function(params, callback) { | ||
params = params || {}; | ||
const parameters = { | ||
options: { | ||
url: '/v1/workspaces/{workspace_id}/intents', | ||
method: 'GET', | ||
json: true, | ||
path: pick(params, ['workspace_id']), | ||
qs: pick(params, ['export']) | ||
}, | ||
requiredParams: ['workspace_id'], | ||
defaultOptions: this._options | ||
}; | ||
return requestFactory(parameters, callback); | ||
}; | ||
/** | ||
* Method: getIntent | ||
* | ||
* Get information about an intent, optionally including all intent content. | ||
* | ||
* @param {Object} params | ||
* @param {String} params.workspace_id | ||
* @param {String} params.intent | ||
* @param {Boolean} [params.export=false] - if true, the full contents of all of the sub-resources are returned | ||
* @param {Function} [callback] | ||
* | ||
*/ | ||
ConversationV1.prototype.getIntent = function(params, callback) { | ||
params = params || {}; | ||
const parameters = { | ||
options: { | ||
url: '/v1/workspaces/{workspace_id}/intents/{intent}', | ||
method: 'GET', | ||
json: true, | ||
path: pick(params, ['workspace_id', 'intent']), | ||
qs: pick(params, ['export']) | ||
}, | ||
requiredParams: ['workspace_id', 'intent'], | ||
defaultOptions: this._options | ||
}; | ||
return requestFactory(parameters, callback); | ||
}; | ||
/** | ||
* Method: updateIntent | ||
* | ||
* Update an existing intent with new or modified data. You must provide JSON data defining the content of the updated intent. | ||
* | ||
* @param {Object} params | ||
* @param {String} params.workspace_id | ||
* @param {String} params.old_intent | ||
* @param {String} params.intent | ||
* @param {String} params.description | ||
* @param {Object} params.examples | ||
* @param {Function} [callback] | ||
* | ||
*/ | ||
ConversationV1.prototype.updateIntent = function(params, callback) { | ||
params = params || {}; | ||
const parameters = { | ||
options: { | ||
url: '/v1/workspaces/{workspace_id}/intents/{old_intent}', | ||
method: 'POST', | ||
json: true, | ||
path: pick(params, ['workspace_id', 'old_intent']), | ||
body: pick(params, ['intent', 'description', 'examples']) | ||
}, | ||
requiredParams: ['workspace_id', 'old_intent', 'intent'], | ||
defaultOptions: this._options | ||
}; | ||
return requestFactory(parameters, callback); | ||
}; | ||
/** | ||
* Method: deleteIntent | ||
* | ||
* Delete an intent from a workspace | ||
* | ||
* @param {Object} params | ||
* @param {String} params.workspace_id | ||
* @param {String} params.intent | ||
* @param {Function} [callback] | ||
* | ||
*/ | ||
ConversationV1.prototype.deleteIntent = function(params, callback) { | ||
params = params || {}; | ||
const parameters = { | ||
options: { | ||
url: '/v1/workspaces/{workspace_id}/intents/{intent}', | ||
method: 'DELETE', | ||
json: true, | ||
path: pick(params, ['workspace_id', 'intent']) | ||
}, | ||
requiredParams: ['workspace_id', 'intent'], | ||
defaultOptions: this._options | ||
}; | ||
return requestFactory(parameters, callback); | ||
}; | ||
/** | ||
* Method: getExamples | ||
* | ||
* List the user input examples for an intent. | ||
* | ||
* @param {Object} params | ||
* @param {String} params.workspace_id | ||
* @param {String} params.intent | ||
* @param {Function} [callback] | ||
* | ||
*/ | ||
ConversationV1.prototype.getExamples = function(params, callback) { | ||
params = params || {}; | ||
const parameters = { | ||
options: { | ||
url: '/v1/workspaces/{workspace_id}/intents/{intent}/examples', | ||
method: 'GET', | ||
json: true, | ||
path: pick(params, ['workspace_id', 'intent']) | ||
}, | ||
requiredParams: ['workspace_id', 'intent'], | ||
defaultOptions: this._options | ||
}; | ||
return requestFactory(parameters, callback); | ||
}; | ||
/** | ||
* Method: createExample | ||
* | ||
* Add a new user input example to an intent. | ||
* | ||
* @param {Object} params | ||
* @param {String} params.workspace_id | ||
* @param {String} params.intent | ||
* @param {String} params.text | ||
* @param {Function} [callback] | ||
* | ||
*/ | ||
ConversationV1.prototype.createExample = function(params, callback) { | ||
params = params || {}; | ||
const parameters = { | ||
options: { | ||
url: '/v1/workspaces/{workspace_id}/intents/{intent}/examples', | ||
method: 'POST', | ||
json: true, | ||
path: pick(params, ['workspace_id', 'intent']), | ||
body: pick(params, ['text']) | ||
}, | ||
requiredParams: ['workspace_id', 'intent'], | ||
defaultOptions: this._options | ||
}; | ||
return requestFactory(parameters, callback); | ||
}; | ||
/** | ||
* Method: deleteExample | ||
* | ||
* Delete a user input example from an intent. | ||
* | ||
* @param {Object} params | ||
* @param {String} params.workspace_id | ||
* @param {String} params.intent | ||
* @param {String} params.text | ||
* @param {Function} [callback] | ||
* | ||
*/ | ||
ConversationV1.prototype.deleteExample = function(params, callback) { | ||
params = params || {}; | ||
const parameters = { | ||
options: { | ||
url: '/v1/workspaces/{workspace_id}/intents/{intent}/examples/{text}', | ||
method: 'DELETE', | ||
json: true, | ||
path: pick(params, ['workspace_id', 'intent', 'text']) | ||
}, | ||
requiredParams: ['workspace_id', 'intent', 'text'], | ||
defaultOptions: this._options | ||
}; | ||
return requestFactory(parameters, callback); | ||
}; | ||
/** | ||
* Method: getExample | ||
* | ||
* Get information about a user input example. | ||
* | ||
* @param {Object} params | ||
* @param {String} params.workspace_id | ||
* @param {String} params.intent | ||
* @param {String} params.text | ||
* @param {Function} [callback] | ||
* | ||
*/ | ||
ConversationV1.prototype.getExample = function(params, callback) { | ||
params = params || {}; | ||
const parameters = { | ||
options: { | ||
url: '/v1/workspaces/{workspace_id}/intents/{intent}/examples/{text}', | ||
method: 'GET', | ||
json: true, | ||
path: pick(params, ['workspace_id', 'intent', 'text']) | ||
}, | ||
requiredParams: ['workspace_id', 'intent', 'text'], | ||
defaultOptions: this._options | ||
}; | ||
return requestFactory(parameters, callback); | ||
}; | ||
/** | ||
* Method: updateExample | ||
* | ||
* Update the text of a user input example. | ||
* | ||
* @param {Object} params | ||
* @param {String} params.workspace_id | ||
* @param {String} params.intent | ||
* @param {String} params.text | ||
* @param {Object} params.example | ||
* @param {Function} [callback] | ||
* | ||
*/ | ||
ConversationV1.prototype.updateExample = function(params, callback) { | ||
params = params || {}; | ||
const parameters = { | ||
options: { | ||
url: '/v1/workspaces/{workspace_id}/intents/{intent}/examples/{old_text}', | ||
method: 'POST', | ||
json: true, | ||
path: pick(params, ['workspace_id', 'intent', 'old_text']), | ||
body: pick(params, ['text']) | ||
}, | ||
requiredParams: ['workspace_id', 'intent', 'old_text', 'text'], | ||
defaultOptions: this._options | ||
}; | ||
return requestFactory(parameters, callback); | ||
}; | ||
module.exports = ConversationV1; |
{ | ||
"name": "watson-developer-cloud", | ||
"version": "2.22.2", | ||
"version": "2.23.0", | ||
"description": "Client library to use the IBM Watson Services and AlchemyAPI", | ||
@@ -5,0 +5,0 @@ "main": "./index", |
Sorry, the diff of this file is not supported yet
331627
7608