ibm-watson
Advanced tools
Comparing version 5.3.0 to 5.3.1
@@ -0,1 +1,8 @@ | ||
## [5.3.1](https://github.com/watson-developer-cloud/node-sdk/compare/v5.3.0...v5.3.1) (2020-01-29) | ||
### Bug Fixes | ||
* **Natural Language Understanding v1:** Restore model field in CategoriesOptions ([93e7b69](https://github.com/watson-developer-cloud/node-sdk/commit/93e7b6946ae92bc0499097bdfb92153509b924a2)) | ||
# [5.3.0](https://github.com/watson-developer-cloud/node-sdk/compare/v5.2.1...v5.3.0) (2020-01-16) | ||
@@ -2,0 +9,0 @@ |
@@ -267,2 +267,12 @@ /** | ||
limit?: number; | ||
/** Enter a [custom | ||
* model](https://cloud.ibm.com/docs/services/natural-language-understanding?topic=natural-language-understanding-customizing) | ||
* ID to override the standard categories model. | ||
* | ||
* The custom categories experimental feature will be retired on 19 December 2019. On that date, deployed custom | ||
* categories models will no longer be accessible in Natural Language Understanding. The feature will be removed | ||
* from Knowledge Studio on an earlier date. Custom categories models will no longer be accessible in Knowledge | ||
* Studio on 17 December 2019. | ||
*/ | ||
model?: string; | ||
} | ||
@@ -269,0 +279,0 @@ /** Relevant text that contributed to the categorization. */ |
{ | ||
"name": "ibm-watson", | ||
"version": "5.3.0", | ||
"version": "5.3.1", | ||
"description": "Client library to use the IBM Watson Services", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -256,3 +256,3 @@ # Watson APIs Node.js SDK | ||
```js | ||
const assistant = new watson.AssistantV1({ | ||
const assistant = new AssistantV1({ | ||
/* authenticator, version, url, etc... */ | ||
@@ -266,3 +266,11 @@ }); | ||
err => { | ||
console.log('error: ', err); | ||
console.log(err); | ||
/* | ||
`err` is an Error object. It will always have a `message` field | ||
and depending on the type of error, it may also have the following fields: | ||
- body | ||
- headers | ||
- name | ||
- code | ||
*/ | ||
} | ||
@@ -272,2 +280,35 @@ ); | ||
### Global Transaction ID | ||
Every SDK call returns a response with a transaction ID in the x-global-transaction-id header. This transaction ID is useful for troubleshooting and accessing relevant logs from your service instance. | ||
#### HTTP Example | ||
```js | ||
const assistant = new AssistantV1({ | ||
/* authenticator, version, url, etc... */ | ||
}); | ||
assistant.message(params).then( | ||
response => { | ||
console.log(response.headers['x-global-transaction-id']); | ||
}, | ||
err => { | ||
console.log(err); | ||
} | ||
); | ||
``` | ||
#### WebSocket Example | ||
```js | ||
const speechToText = new SpeechToTextV1({ | ||
/* authenticator, version, url, etc... */ | ||
}); | ||
const recognizeStream = recognizeUsingWebSocket(params); | ||
// getTransactionId returns a Promise that resolves to the ID | ||
recognizeStream.getTransactionId().then( | ||
globalTransactionId => console.log(globalTransactionId), | ||
err => console.log(err), | ||
); | ||
``` | ||
## Data collection opt-out | ||
@@ -274,0 +315,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
5603415
107857
908