Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

ibm-watson

watson-developer-cloud59.2kApache-2.010.0.0TypeScript support: included

Client library to use the IBM Watson Services

assistant, discovery, ibm, natural language understanding, speech to text, text to speech, watson developer cloud, watson, wdc

readme

Watson APIs Node.js SDK

Build and Test Deploy and Publish codecov npm-version npm-downloads semantic-release

Deprecated builds

Build Status

Node.js client library to use the Watson APIs.

Before you begin

Prerequisites

  • Node >= 20: This SDK is tested with Node versions 16 and up. It may work on previous versions but this is not officially supported.

Installation

npm install ibm-watson

Usage

import AssistantV2 from 'ibm-watson/assistant/v2';
import { IamAuthenticator } from 'ibm-watson/auth';

const assistantClient = new AssistantV2({
  authenticator: new IamAuthenticator({ apikey: '{apikey}' }),
  version: '{version}',
});

// ...

The examples folder has basic and advanced examples. The examples within each service assume that you already have service credentials.

Client-side usage

Starting with v5.0.0, the SDK should work in the browser, out of the box, with most bundlers.

See the examples/ folder for Browserify and Webpack client-side SDK examples (with server-side generation of auth tokens.)

Note: not all services currently support CORS, and therefore not all services can be used client-side. Of those that do, most require an auth token to be generated server-side via the Authorization Service.

Authentication

Watson services are migrating to token-based Identity and Access Management (IAM) authentication.

  • With some service instances, you authenticate to the API by using IAM.
  • In other instances, you authenticate by providing the username and password for the service instance.
  • If you are using a Watson service on ICP, you will need to authenticate in a specific way.
  • If you are using a Watson service on AWS, you will need to authenticate using mcsp.

Authentication is accomplished using dedicated Authenticators for each authentication scheme. Import authenticators from ibm-watson/auth or rely on externally-configured credentials which will be read from a credentials file or environment variables.

To learn more about the Authenticators and how to use them with your services, see the detailed documentation.

Getting credentials

To find out which authentication to use, view the service credentials. You find the service credentials for authentication the same way for all Watson services:

  1. Go to the IBM Cloud Dashboard page.
  2. Either click an existing Watson service instance in your resource list or click Create resource > AI and create a service instance.
  3. Click on the Manage item in the left nav bar of your service instance.

On this page, you should be able to see your credentials for accessing your service instance.

In your code, you can use these values in the service constructor or with a method call after instantiating your service.

Supplying credentials

There are two ways to supply the credentials you found above to the SDK for authentication:

  • Allow the credentials to be automatically read from the environment
  • Instantiate an authenticator with explicit credentials and use it to create your service

Credentials file (easier!)

With a credentials file, you just need to put the file in the right place and the SDK will do the work of parsing it and authenticating. You can get this file by clicking the Download button for the credentials in the Manage tab of your service instance.

The file downloaded will be called ibm-credentials.env. This is the name the SDK will search for and must be preserved unless you want to configure the file path (more on that later). The SDK will look for your ibm-credentials.env file in the following places (in order):

  • Directory provided by the environment variable IBM_CREDENTIALS_FILE
  • Your system's home directory
  • Your current working directory (the directory Node is executed from)

As long as you set that up correctly, you don't have to worry about setting any authentication options in your code. So, for example, if you created and downloaded the credential file for your Assistant instance, you just need to do the following:

const AssistantV2 = require('ibm-watson/assistant/v2');
const assistant = new AssistantV2({ version: '2024-08-25' });

And that's it!

If you're using more than one service at a time in your code and get two different ibm-credentials.env files, just put the contents together in one ibm-credentials.env file and the SDK will handle assigning credentials to their appropriate services.

Special Note: Due to legacy issues in Assistant V1 and V2, the following parameter serviceName must be added when creating the service object:

const AssistantV2 = require('ibm-watson/assistant/v2');
const assistant = new AssistantV2({
  version: '2024-08-25',
  serviceName: 'assistant',
})

It is worth noting that if you are planning to rely on VCAP_SERVICES for authentication then the serviceName parameter MUST be removed otherwise VCAP_SERVICES will not be able to authenticate you. See Cloud Authentication Prioritization for more details.

If you would like to configure the location/name of your credential file, you can set an environment variable called IBM_CREDENTIALS_FILE. This will take precedence over the locations specified above. Here's how you can do that:

export IBM_CREDENTIALS_FILE="<path>"

where <path> is something like /home/user/Downloads/<file_name>.env. If you just provide a path to a directory, the SDK will look for a file called ibm-credentials.env in that directory.

Manually

The SDK also supports setting credentials manually in your code, using an Authenticator.

IAM

Some services use token-based Identity and Access Management (IAM) authentication. IAM authentication uses a service API key to get an access token that is passed with the call. Access tokens are valid for approximately one hour and must be regenerated.

To use IAM authentication, you must use an IamAuthenticator or a BearerTokenAuthenticator.

  • Use the IamAuthenticator to have the SDK manage the lifecycle of the access token. The SDK requests an access token, ensures that the access token is valid, and refreshes it if necessary.
  • Use the BearerTokenAuthenticator if you want to manage the lifecycle yourself. For details, see Authenticating with IAM tokens. If you want to switch your authenticator, you must override the authenticator property directly.
ICP

To use the SDK in a Cloud Pak, use the CloudPakForDataAuthenticator. This will require a username, password, and URL.

MCSP

To use the SDK through a third party cloud provider (such as AWS), use the MCSPAuthenticator. This will require the base endpoint URL for the MCSP token service (e.g. https://iam.platform.saas.ibm.com) and an apikey.

import AssistantV2 from 'ibm-watson/assistant/v2'
import { McspAuthenticator } from 'ibm-watson/auth';

# In the constructor, letting the SDK manage the token
const authenticator = new McspAuthenticator({
    url: 'token_service_endpoint',
    apikey: 'apikey',
})
const assistant = AssistantV2(version='2024-08-25',
                        authenticator=authenticator)
assistant.setServiceUrl('<url_as_per_region>')

Cloud Authentication Prioritization

When uploading your application to IBM Cloud there is a certain priority Watson services will use when looking for proper credentials. The order is as follows:

  1. Programmatic (i.e. IamAuthenticator)
  2. Credentials File
  3. VCAP_SERVICES (an environment variable used by IBM Cloud, details found here)

Setting the Service URL

You can set or reset the base URL after constructing the client instance using the setServiceUrl method:

const AssistantV2 = require('ibm-watson/assistant/v2');

const assistant = AssistantV2({
/* authenticator, version, etc... */
});

assistant.setServiceUrl('<new url>');

Promises

All SDK methods are asynchronous, as they are making network requests to Watson services. To handle receiving the data from these requests, the SDK offers support with Promises.

const AssistantV2 = require('ibm-watson/assistant/v2');

const assistant = new AssistantV2({
/* authenticator, version, serviceUrl, etc... */
});

// using Promises
assistant.listAssistants()
  .then(body => {
    console.log(JSON.stringify(body, null, 2));
  })
  .catch(err => {
    console.log(err);
  });

// using Promises provides the ability to use async / await
async function callAssistant() { // note that callAssistant also returns a Promise
  const body = await assistant.listAssistants();
}

Sending request headers

Custom headers can be passed with any request. Each method has an optional parameter headers which can be used to pass in these custom headers, which can override headers that we use as parameters.

For example, this is how you can pass in custom headers to Watson Assistant service. In this example, the 'custom' value for 'Accept-Language' will override the default header for 'Accept-Language', and the 'Custom-Header' while not overriding the default headers, will additionally be sent with the request.

const assistant = new watson.AssistantV2({
/* authenticator, version, serviceUrl, etc... */
});

assistant.message({
  workspaceId: 'something',
  input: {'text': 'Hello'},
  headers: {
    'Custom-Header': 'custom',
    'Accept-Language': 'custom'
  }
})
  .then(response => {
    console.log(JSON.stringify(response.result, null, 2));
  })
  .catch(err => {
    console.log('error: ', err);
  });

Parsing HTTP response

The SDK now returns the full HTTP response by default for each method.

Here is an example of how to access the response headers for Watson Assistant:

const assistant = new AssistantV2({
/* authenticator, version, serviceUrl, etc... */
});

assistant.message(params).then(
  response => {
    console.log(response.headers);
  },
  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
    */
  }
);

Global Transaction ID

Every SDK call returns a response with a transaction ID in the X-Global-Transaction-Id header. Together with the service instance region, this ID helps support teams troubleshoot issues from relevant logs.

HTTP Example

const assistant = new AssistantV2({
/* authenticator, version, serviceUrl, etc... */
});

assistant.message(params).then(
  response => {
    console.log(response.headers['X-Global-Transaction-Id']);
  },
  err => {
    console.log(err);
  }
);

WebSocket Example

const speechToText = new SpeechToTextV1({
/* authenticator, version, serviceUrl, 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),
);

However, the transaction ID isn't available when the API doesn't return a response for some reason. In that case, you can set your own transaction ID in the request. For example, replace <my-unique-transaction-id> in the following example with a unique transaction ID.

const assistant = new AssistantV2({
/* authenticator, version, serviceUrl, etc... */
});

assistant.message({
  workspaceId: 'something',
  input: {'text': 'Hello'},
  headers: {
    'X-Global-Transaction-Id': '<my-unique-transaction-id>'
  }
}).then(
  response => {
    console.log(response.headers['X-Global-Transaction-Id']);
  },
  err => {
    console.log(err);
  }
);

Data collection opt-out

By default, all requests are logged. This can be disabled of by setting the X-Watson-Learning-Opt-Out header when creating the service instance:

const myInstance = new watson.WhateverServiceV1({
  /* authenticator, version, serviceUrl, etc... */
  headers: {
    "X-Watson-Learning-Opt-Out": true
  }
});

Configuring the HTTPS Agent

The SDK provides the user with full control over the HTTPS Agent used to make requests. This is available for both the service client and the authenticators that make network requests (e.g. IamAuthenticator). Outlined below are a couple of different scenarios where this capability is needed. Note that this functionality is for Node environments only - these configurtions will have no effect in the browser.

Use behind a corporate proxy

To use the SDK (which makes HTTPS requests) behind an HTTP proxy, a special tunneling agent must be used. Use the package tunnel for this. Configure this agent with your proxy information, and pass it in as the HTTPS agent in the service constructor. Additionally, you must set proxy to false in the service constructor. If using an Authenticator that makes network requests (IAM or CP4D), you must set these fields in the Authenticator constructor as well.

See this example configuration:

const tunnel = require('tunnel');
const AssistantV2 = require('ibm-watson/assistant/v2');
const { IamAuthenticator } = require('ibm-watson/auth');

const httpsAgent = tunnel.httpsOverHttp({
  proxy: {
    host: 'some.host.org',
    port: 1234,
  },
});

const assistant = new AssistantV2({
  authenticator: new IamAuthenticator({
    apikey: 'fakekey-1234'
    httpsAgent, // not necessary if using Basic or BearerToken authentication
    proxy: false,
  }),
  version: '2024-08-25',
  httpsAgent,
  proxy: false,
});

Sending custom certificates

To send custom certificates as a security measure in your request, use the cert, key, and/or ca properties of the HTTPS Agent. See this documentation for more information about the options. Note that the entire contents of the file must be provided - not just the file name.

const AssistantV2 = require('ibm-watson/assistant/v2');
const { IamAuthenticator } = require('ibm-watson/auth');

const certFile = fs.readFileSync('./my-cert.pem');
const keyFile = fs.readFileSync('./my-key.pem');

const assistant = new AssistantV2({
  authenticator: new IamAuthenticator({
    apikey: 'fakekey-1234',
    httpsAgent: new https.Agent({
      key: keyFile,
      cert: certFile,
    })
  }),
  version: '2024-08-25',
  httpsAgent: new https.Agent({
    key: keyFile,
    cert: certFile,
  }),
});

Disabling SSL Verification

The HTTP client can be configured to disable SSL verification. Note that this has serious security implications - only do this if you really mean to! ⚠️

To do this, set disableSslVerification to true in the service constructor and/or authenticator constructor, like below:

const assistant = new AssistantV2({
  serviceUrl: '<service_url>',
  version: '<version-date>',
  authenticator: new IamAuthenticator({ apikey: '<apikey>', disableSslVerification: true }), // this will disable SSL verification for requests to the token endpoint
  disableSslVerification: true, // this will disable SSL verification for any request made with this client instance
});

All other configuration options

To see all possible https agent configuration options go to this link for the quickest and most readable format. For even more detailed information, you can go to the Node documentation here

Documentation

You can find links to the documentation at https://cloud.ibm.com/developer/watson/documentation. Find the service that you're interested in, click API reference, and then select the Node tab.

Questions

If you have issues with the APIs or have a question about the Watson services, see Stack Overflow.

IBM Watson services

Assistant v2

Use the Assistant service to determine the intent of a message.

Note: You must first create a workspace via IBM Cloud. See the documentation for details.

const AssistantV2 = require('ibm-watson/assistant/v2');
const { IamAuthenticator } = require('ibm-watson/auth');

const assistant = new AssistantV2({
  authenticator: new IamAuthenticator({ apikey: '<apikey>' }),
  serviceUrl: 'https://api.us-south.assistant.watson.cloud.ibm.com',
  version: '2018-09-19'
});

assistant.message(
  {
    input: { text: "What's the weather?" },
    assistantId: '<assistant id>',
    sessionId: '<session id>',
  })
  .then(response => {
    console.log(JSON.stringify(response.result, null, 2));
  })
  .catch(err => {
    console.log(err);
  });

Assistant v1

Use the Assistant service to determine the intent of a message.

Note: You must first create a workspace via IBM Cloud. See the documentation for details.

const AssistantV2 = require('ibm-watson/assistant/v2');
const { IamAuthenticator } = require('ibm-watson/auth');

const assistant = new AssistantV2({
  authenticator: new IamAuthenticator({ apikey: '<apikey>' }),
  serviceUrl: 'https://api.us-south.assistant.watson.cloud.ibm.com',
  version: '2024-08-25'
});

assistant.message(
  {
    input: { text: "What's the weather?" },
    workspaceId: '<workspace id>'
  })
  .then(response => {
    console.log(JSON.stringify(response.result, null, 2));
  })
  .catch(err => {
    console.log(err);
  });

Discovery v2

Use the Discovery Service to search and analyze structured and unstructured data.

const DiscoveryV2 = require('ibm-watson/discovery/v2');
const { IamAuthenticator } = require('ibm-watson/auth');

const discovery = new DiscoveryV2({
  authenticator: new IamAuthenticator({ apikey: '<apikey>' }),
  serviceUrl: 'https://api.us-south.discovery.watson.cloud.ibm.com',
  version: '2019-11-22'
});

discovery.query(
  {
    projectId: '<project_id>',
    collectionId: '<collection_id>',
    query: 'my_query'
  })
  .then(response => {
    console.log(JSON.stringify(response.result, null, 2));
  })
  .catch(err => {
    console.log(err);
  });

Natural Language Understanding

Natural Language Understanding is a collection of natural language processing APIs that help you understand sentiment, keywords, entities, high-level concepts and more.

const fs = require('fs');
const NaturalLanguageUnderstandingV1 = require('ibm-watson/natural-language-understanding/v1');
const { IamAuthenticator } = require('ibm-watson/auth');

const nlu = new NaturalLanguageUnderstandingV1({
  authenticator: new IamAuthenticator({ apikey: '<apikey>' }),
  version: '2018-04-05',
  serviceUrl: 'https://api.us-south.natural-language-understanding.watson.cloud.ibm.com'
});

nlu.analyze(
  {
    html: file_data, // Buffer or String
    features: {
      concepts: {},
      keywords: {}
    }
  })
  .then(response => {
    console.log(JSON.stringify(response.result, null, 2));
  })
  .catch(err => {
    console.log('error: ', err);
  });

Speech to Text

Use the Speech to Text service to recognize the text from a .wav file.

const fs = require('fs');
const SpeechToTextV1 = require('ibm-watson/speech-to-text/v1');
const { IamAuthenticator } = require('ibm-watson/auth');

const speechToText = new SpeechToTextV1({
  authenticator: new IamAuthenticator({ apikey: '<apikey>' }),
  serviceUrl: 'https://api.us-south.speech-to-text.watson.cloud.ibm.com'
});

const params = {
  // From file
  audio: fs.createReadStream('./resources/speech.wav'),
  contentType: 'audio/l16; rate=44100'
};

speechToText.recognize(params)
  .then(response => {
    console.log(JSON.stringify(response.result, null, 2));
  })
  .catch(err => {
    console.log(err);
  });

// or streaming
fs.createReadStream('./resources/speech.wav')
  .pipe(speechToText.recognizeUsingWebSocket({ contentType: 'audio/l16; rate=44100' }))
  .pipe(fs.createWriteStream('./transcription.txt'));

Text to Speech

Use the Text to Speech service to synthesize text into an audio file.

const fs = require('fs');
const TextToSpeechV1 = require('ibm-watson/text-to-speech/v1');
const { IamAuthenticator } = require('ibm-watson/auth');

const textToSpeech = new TextToSpeechV1({
  authenticator: new IamAuthenticator({ apikey: '<apikey>' }),
  serviceUrl: 'https://api.us-south.text-to-speech.watson.cloud.ibm.com'
});

const params = {
  text: 'Hello from IBM Watson',
  voice: 'en-US_AllisonVoice', // Optional voice
  accept: 'audio/wav'
};

// Synthesize speech, correct the wav header, then save to disk
// (wav header requires a file length, but this is unknown until after the header is already generated and sent)
// note that `repairWavHeaderStream` will read the whole stream into memory in order to process it.
// the method returns a Promise that resolves with the repaired buffer
textToSpeech
  .synthesize(params)
  .then(response => {
    const audio = response.result;
    return textToSpeech.repairWavHeaderStream(audio);
  })
  .then(repairedFile => {
    fs.writeFileSync('audio.wav', repairedFile);
    console.log('audio.wav written with a corrected wav header');
  })
  .catch(err => {
    console.log(err);
  });


// or, using WebSockets
textToSpeech.synthesizeUsingWebSocket(params);
synthStream.pipe(fs.createWriteStream('./audio.ogg'));
// see more information in examples/text_to_speech_websocket.js

Unauthenticated requests

The SDK always expects an authenticator to be passed in. To make an unautuhenticated request, use the NoAuthAuthenticator.

const watson = require('ibm-watson');
const { NoAuthAuthenticator } = require('ibm-watson/auth');

const assistant = new watson.AssistantV2({
  authenticator: new NoAuthAuthenticator(),
});

Debug

This library relies on the axios npm module written by axios to call the Watson Services. To debug the apps, add 'axios' to the NODE_DEBUG environment variable:

$ NODE_DEBUG='axios' node app.js

where app.js is your Node.js file.

Tests

Running all the tests:

$ npm test

Running a specific test:

$ jest '<path to test>'

Open source @ IBM

Find more open source projects on the IBM Github Page.

Contributing

See CONTRIBUTING.

We love to highlight cool open-source projects that use this SDK! If you'd like to get your project added to the list, feel free to make an issue linking us to it.

License

This library is licensed under Apache 2.0. Full license text is available in [COPYING][license].

changelog

10.0.0 (2024-12-04)

Code Refactoring

  • auth: remove deprecated AuthorizationV1 class (3f8addb)

Features

  • discov1: remove discoV1 (936edc1)
  • discov2: add functions for new batches api (5f81415)
  • lt: remove lt and other deprecated resources (6478da6)
  • stt: add new speech models (c4105ca)
  • WxA: add new functions and update required params (b710609)

BREAKING CHANGES

  • auth: AuthorizationV1 is removed in favor of the long supported node-sdk-core authenticators located in /auth
  • WxA: environmentId now required for message and messageStateless functions

Add support for message streaming and new APIs New functions: createProviders, listProviders, updateProviders, createReleaseExport, downloadReleaseExport, createReleaseImport, getReleaseImportStatus, messageStream, messageStreamStateless

  • lt: LanguageTranslator functionality has been removed
  • discov1: DiscoveryV1 functionality has been removed

9.1.0 (2024-05-17)

Features

  • discov2: add ocrEnabled parameter (5a9c30e)
  • stt: add speechBeginEvent param to recognize func (8f19640)
  • stt: remove interimResults and lowLatency wss params (6c79d93)

9.0.1 (2024-03-13)

Bug Fixes

  • stt: change smartFormattingVersion type to number (3db377b)
  • wss: add smartFormattingVersion param (d64f155)

9.0.0 (2024-02-26)

Features

  • disco-v2: interface changes (619d09b)
  • disco-v2: new params for EnrichmentOptions (e826b89)
  • mcsp: expose McspAuthenticator (94d3efc)
  • stt: new params (06bb328)
  • ts: add better ts typing and linting (762c6bf)
  • wa-v2: new params orchestration and asyncCallout (5124107)
  • wa-v2: support for private variables (784c476)

BREAKING CHANGES

  • wa-v2: Renaming and changing of multiple interfaces

8.0.0 (2023-03-16)

Bug Fixes

  • deps: upgrade core version to address jsonwebtoken vulnerability (67b169d)

Features

  • assistantv2: add several new functions (2eae4e9)
  • assistantv2: improved typing (730114e)
  • discov2: new aggregation types (9409082)
  • lt,stt: add and remove model constants (d41c7ee)
  • nlu: remove all sentimentModel functions (0f17d68)
  • nlu: remove beta model param from Sentiment (8815b1a)
  • stt, tts: add more models (93cbe80)
  • tts: add new params to websocket function (13ab63f)
  • tts: add params and add model constants (b9fad7b)

BREAKING CHANGES

  • assistantv2: createSession param removed
  • assistantv2: removing and changing of interface properties
  • discov2: confidence property removed
  • discov2: smartDocumentUnderstanding param removed
  • discov2: QueryAggregation structure changed
  • nlu: remove all sentimentModel functions and interfaces

7.1.2 (2022-10-25)

Bug Fixes

  • deps: upgrade core version to address file-type vulnerability (c724fc3)

7.1.1 (2022-08-16)

Bug Fixes

  • package.json: rollback core version (f74c48c)

7.1.0 (2022-08-10)

Features

  • assistant-v1: update models and add new methods (e320105)
  • assistant-v2: update models and add new methods (0a66745)
  • discovery-v2: update models and add several new methods (d8bf765)
  • nlu: add trainingParameters parameter (6e3f676)
  • package.json: upgrade bm-cloud-sdk-core (ab019de)
  • stt: update parameters (3be4085)
  • tts: add parameters (a3ed589)
  • wss: add new websocket params (8cce07c)

7.0.0 (2022-03-21)

Features

  • assistantv1: assistant v1 generated with new spec (5c6e9db)
  • assistantv2: assistant v2 generated with new spec (7f7d96f)
  • compare-comply: remove compare-comply (a851442)
  • discoveryv1: discovery v1 generated with new spec (cf1d976)
  • discoveryv1: regen with more recent defs (46752a1)
  • lt: lT generated with new spec (ed54e99)
  • nlc: remove NLC (698b3be)
  • nlu: nLU generated with new spec (beeb8a0)
  • pi: remove PI (350ed36)
  • secrets: run detect secrets (5a5690a)
  • stt: change addGrammar to take a file (d21b462)
  • stt: stt generated with new spec (ec98a33)
  • tone analyzer: remove tone analyzer (fbd5be1)
  • tts: tTS generated with new spec (b1e87d3)
  • vizrec: remove vizrec (a6f3134)

BREAKING CHANGES

  • stt: addGrammar no longer accepts a string and must take a file
  • discoveryv1: QueryAggregation subclasses changed, be sure to regen models
  • stt: Changed file type of addGrammar from String to Data
  • discoveryv1: QueryAggregation - subclasses have changed
  • assistantv2: MessageOutputDebug - renamed DialogNodesVisited to DialogNodeVisited; RuntimeEntity
  • removed optional metadata property
  • assistantv1: Removed required text property on outputdata and removed optional metadata property from runtimeentity
  • tone analyzer: Tone Analyzer functionality has been removed
  • vizrec: VizRec functionality has been removed
  • pi: PI functionality has been removed
  • nlc: NLC functionality has been removed
  • compare-comply: Compare and comply functionality has been removed

6.2.2 (2022-01-19)

Bug Fixes

  • stt: update word confidence and timestamps type (9f4d664)

6.2.1 (2021-09-21)

Bug Fixes

  • stt: fix timestamps type to properly reflect response model (1efa983)

6.2.0 (2021-09-14)

Bug Fixes

  • assistant_v2 discovery_v1: regen with final release (cc99978)
  • discovery_v1: update status model (bb69a7e)
  • nlu: fix listClassificationModels (8c09145)
  • package.json: bump cloud sdk core version (f4579b4)
  • regenerate with correct version (16420fc)
  • package.json: bump axios version (29b9b4e)

Features

  • assistant_v1: alt_text property added (32c7d2e)
  • assistant_v2: add properties to model and Image response (6f0bb29)
  • discovery_v2: update CreateProjectConstants Type enum (f272fc6)
  • stt: support more languages (84bb18d)
  • tts: new voice models added (1e64b92)

6.1.2 (2021-08-25)

Bug Fixes

6.1.1 (2021-06-02)

Bug Fixes

  • tts: remove unnecessary filename param (d30bb25)

6.1.0 (2021-05-27)

Bug Fixes

  • nlu: remove ListCategoriesModelsResponse (82a82a3)
  • wss,assistantv1: address review changes (ab0c8a2)

Features

  • assistantv1: generation release changes (8b10b2d)
  • assistantv2: generation release changes (403145e)
  • discov2: generation release changes (8e70b7f)
  • nlu: generation release changes (4d74c0a)
  • stt: update websocket parameters (8f257e7)
  • stt-tts: generation release changes (1bc946b)

6.0.4 (2021-04-05)

Bug Fixes

  • update core to enable use with more front-end environments (bb57a23)

6.0.3 (2021-02-22)

Bug Fixes

  • cc: add deprecation warning for Compare and Comply (85c218a)
  • stt: handedit- fix timestamps time to properly reflect response model (735bcd2), closes #1084

6.0.2 (2021-01-08)

Bug Fixes

  • package.json: update dependencies to cover vulnerabilities (2b839c8)

6.0.1 (2020-12-22)

Bug Fixes

6.0.0 (2020-12-11)

BREAKING CHANGES

  • Support for callbacks dropped
  • Support for Node v10 dropped
  • changes to services, see MIGRATION-V6.md

5.7.1 (2020-09-29)

Bug Fixes

  • add getTransactionId method to the SynthesizeStream (#1058) (21a5a7f)
  • stop ignoring serviceUrl for Websocket methods (#1060) (1901aae)

5.7.0 (2020-08-27)

Bug Fixes

  • added test to getDocumentStatus() (e5c81d5)
  • comments and necessary required params (bef8089)
  • small changes (f7a5e3c)
  • visual reconition v4 (b12f11e)

Features

  • assistant-v2: new method: listLogs (ff6b79c)
  • discovery-v2: new methods: (01d426c)
  • discovery-v2-test: added new tests for the new methods coming to (82ea90f)
  • language-translator-v3: new method: listLanguages (b9a7d41)
  • text-to-speech-v1: new voices added (be94a1a)

5.6.2 (2020-08-06)

Bug Fixes

  • support disableSslVerification when user provides https agent (#1055) (4ab77e1)

5.6.1 (2020-07-24)

Bug Fixes

5.6.0 (2020-06-03)

Bug Fixes

Features

  • assistant-v2: new method: messageStateless (0ccc5bf)
  • visual-recognition-v4: new method: getModelFile (55aec8c)

5.5.0 (2020-04-24)

Bug Fixes

  • discovery-v1: property indexed corrected to available for model EnvironmentDocuments (7bc2ccd)

Features

  • assistant-v1: RuntimeEntityAlternative model added (9ad75d7)
  • assistant-v2: MessageContextSkillSystem model added (40fd822)
  • speech-to-text-v1: parameters speechDetectorSensitivity, backgroundAudioSuppression, added to recognize (7c91ea2)
  • text-to-speech-v1: new voices and languages added (dad6e0e)

5.4.0 (2020-02-13)

Features

  • assistant-v1: includeAudit and append parameters added to a number of methods (35fb2a5)
  • visual-recognition-v4: new methods added: listObjectMetadata, updateObjectMetadata, getObjectMetadata, deleteObject (85281ae)

5.3.1 (2020-01-29)

Bug Fixes

  • Natural Language Understanding v1: Restore model field in CategoriesOptions (93e7b69)

5.3.0 (2020-01-16)

Features

  • speech-to-text: endOfPhraseSilenceTime and splitTranscriptAtPhraseEnd params added to recognize, createJob, and recognizeUsingWebSocket methods (e3ff8db)
  • add serviceName parameter for all services (964e9e1)

5.2.1 (2019-12-09)

Bug Fixes

5.2.0 (2019-11-27)

Features

  • add support for discovery v2 service (c2a79ff)
  • assistant-v1: webhooks parameter added to createWorkspace and updateWorkspace (c61b794)
  • visual-recognition-v4: new method added - getTrainingUsage (0756878)

5.1.0 (2019-10-07)

Features

  • text-to-speech: add method to repair wav header for a stream (#981) (42b0913)

5.0.0 (2019-10-04)

Bug Fixes

  • make RecognizeStream.readableObjectMode always return Boolean (#943) (a276df4)

Build System

  • drop support for Node versions 6 and 8 (3ea1fd7)

Code Refactoring

  • change all websocket method parameters to lower camel case (#941) (cb6711f)

Features

  • add support for new authenticators in all sdks and add new service features for major release (#946) (3acffc5)

BREAKING CHANGES

  • Passing individual credentials to the service constructor will no longer work. An Authenticator must be initialized and passed in. For more information, see the migration guide.
  • All parameters have been converted to their lower camel case version.
  • Support for the token parameter has been removed
  • Support for the customization_id parameter has been removed
  • Method setAuthorizationHeaderToken has been removed from the WebSocket Stream classes
  • RecognizeStream.readableObjectMode will always be a Boolean value - before, it could have been undefined.
  • This SDK may no longer work with applications running on Node 6 or 8.

4.5.1 (2019-09-19)

Bug Fixes

  • pass user-defined http(s) agent to websocket methods (#953) (4f1679c)

4.5.0 (2019-09-19)

Bug Fixes

  • ignore unecessary files for npm releases (#962) (93eb677)

Features

  • separate strings out of primary SynthesizeStream pipe (#957) (3014478)

4.4.0 (2019-08-20)

Features

  • compare-comply: new model ContractCurrencies added (#935) (132ad09)

4.3.4 (2019-08-13)

Bug Fixes

  • disable analytics headers in browser to fix cors issues (bdcf9d6)
  • disable analytics headers in browser to fix cors issues (#932) (bba47a0)

4.3.3 (2019-08-08)

Bug Fixes

  • send correct user-agent header for websocket methods (#930) (f24cac2)

4.3.2 (2019-08-07)

Bug Fixes

  • core: share request config across all requests (#928) (7fd5577)

4.3.1 (2019-08-05)

Bug Fixes

  • extend constructor options types to allow additional properties (#925) (03d241a)

4.3.0 (2019-07-25)

Bug Fixes

  • compare-comply: contract_type corrected to contract_types in model ClassifyReturn (a114881)

Features

  • assistant-v2: support for search skill added (a1c4f6d)

4.2.6 (2019-07-23)

Bug Fixes

  • properly store refreshed tokens in websocket libraries (#920) (4b8df28)

4.2.5 (2019-07-19)

Bug Fixes

  • AuthorizationV1.Options requires type definitions for iam_a… (#917) (b38d692)
  • type definitions for iam_apikey and ibm_url (13ac681)

4.2.4 (2019-07-17)

Bug Fixes

  • refresh iam tokens in websocket methods (#913) (5a2876a)

4.2.3 (2019-07-17)

Bug Fixes

  • speech-to-text: support all allowed parameters in WebSocket method (b91c1e2)
  • speech-to-text: support all allowed parameters in WebSocket… (#915) (e9ef5da)

4.2.2 (2019-07-12)

Bug Fixes

  • only set readableObjectMode in recognize-stream if not present (#907) (155c005)

4.2.1 (2019-06-14)

Bug Fixes

  • remove ReadStream since ReadableStream is correct (b9f8c73)
  • update second occurence of Map to Record (3ded63a)
  • use Record instead of Map type for classifier update (6dec631)

4.2.0 (2019-06-10)

Bug Fixes

  • change Object types to custom JsonObject (800afbe)
  • updates from ibm-cloud-sdk-core: (dfabc7a)
    • expose the body in the detailed response under the field result
    • add new token manager for ICP4D
    • default request body size to Infinity

Features

  • language-translator: the following methods have been added: deleteDocument, getDocumentStatus, getTranslatedDocument, listDocuments, translateDocument (a0f2c20)
  • Add processing_metrics, processing_metrics_interval and audio_metrics as query params in WebSocket recognize (5b09882)

4.1.3 (2019-05-24)

Bug Fixes

  • don't return request object in detailed response (31628ff)
  • don't return request object in detailed response (#891) (9f9174c)

4.1.2 (2019-05-22)

Bug Fixes

  • enable axios debug, disable gzip (4e86717)

4.1.1 (2019-05-13)

Bug Fixes

  • do not read credentials file in browser (718895c)

4.1.0 (2019-04-29)

Features

  • example: add speech-to-text-to-redis example (238cec3)

4.0.2 (2019-04-24)

Bug Fixes

  • update vulnerable dependencies (26f7dce)

4.0.1 (2019-03-29)

Bug Fixes

  • add compare comply keyword to package.json (to trigger release) (7905445)

4.0.0 (2019-03-28)

Bug Fixes

  • icp: disabling ssl verification now works for websocket connection (f8466c8)
  • update ibm-cloud-sdk-core to 0.1.1 (29f87df)

Build System

  • remove support for node 4 (1548413)

chore

  • remove all code dealing with api_key in the base class (92d48e2)
  • conversation: remove conversation service and all associated code (c810de2)
  • dialog: remove dialog service and all associated (7d7408f)
  • language-translator-v2: remove language translator v2 service and all associated code (83d9232)
  • personality-insights: remove Personality Insights v2 (e5e5302)

Code Refactoring

  • assistant-v1: change name of variable export to _export (91ed5a4)
  • assistant-v2: parameter names changed for v4 (f6adbe9)
  • compare-comply: parameter names changed for v4 (908d8e7)
  • refactor core code to use axios instead of request for network requests (f656731)
  • discovery: remove compatibility layer for discovery (8571a1f)
  • discovery: rename model QueryResultResultMetadata to QueryResultMetadata (b1a124c)
  • natural-language-classifier: remove compatibility layer for natural language classifier (0ac087c)
  • natural-language-understanding: remove compatibility layer for natural language understanding (359cc79)
  • personality-insights-v3: remove compatibility layer for personality insights v3 (1b27685)
  • speech-to-text: remove compatibility layer for speech to text (310bdd0)
  • text-to-speech: remove compatibility layer for text to speech (6994d3c)
  • tone-analyzer: remove compatibility layer for tone analyzer (9f10898)
  • visual_recognition: v4 changes (3957e2d)
  • in query and federatedQuery, only accept string values for certain parameters. (06d7c65)
  • in discovery, rename getSourceCredentials to getCredentials (6fac701)
  • visual-recognition: remove compatibility layer for visual recognition (6377067)
  • remove index.ts file as it was deprecated starting in v3 (4ea3c27)
  • remove module for converting training_data to csv (dd534f6)
  • require filenames for createStopwordList in discovery and convertToHTML in compare comply (8f7c62f)
  • stop using cookies in requests (09e0e91)

Features

  • discovery: add new methods: createTokenizationDictionary, deleteTokenizationDictionary, and getTokenizationDictionaryStatus (d5ba660)
  • discovery: new parameters added to match updates to the service (838b044)
  • add sort query parameter to getWorkspace() (1df75ac)
  • add model MessageContextSkill (15a4c7f)
  • new error formatter, provides the same information regardless of service (c324ab0)
  • The SDK now returns a Promise for all methods if a callback is not specified. Callbacks can still be used for backwards compatibility. (fd6e20b)

BREAKING CHANGES

  • visual_recognition: For updateClassifier and createClassifier, the parameter {classname}_positive_examples is changed to a map called positive_examples with classnames as keys.

    • See the migration guide, UPGRADE-4.0.md, for more information.
  • Node 4 will no longer be supported, considered during development, or tested with.

    • To migrate your code, upgrade to a newer major version of Node.
  • assistant-v2: For updateValue, parameter new_type is changed to new_value_type. For updateDialogNode, parameter new_type is changed to new_node_type.

    • These method renames are breaking changes. Update the method names to migrate your code.
  • There is no more index.ts file, so importing with require('watson-developer-cloud') will no longer work.

    • To migrate your code, import only the services that you need, e.g. require('watson-developer-cloud/speech-to-text/v1').
  • The methods createStopwordList in discovery and convertToHTML in comply comply now have new, required parameters

    • To migrate your code, include the parameter stopword_filename for createStopwordList, and filename for convertToHTML
  • assistant-v1: The Assistant v1 parameter export is now _export is all instances.

    • To migrate your code, change any use of the export parameter to _export.
  • The SDK used to document and allow array values for these parameters, converting them to strings to be sent to the service.

    • To migrate your code, convert any array values for these parameters to comma-separated values in a string.
  • The module json-training-to-csv is no longer available.

    • To migrate your code, provide training_data to NLC as a CSV file.
  • Cookies will no longer be sent or stored in requests. This should have very little impact on usage but is techincally a breaking change.

    • This affects internal functionality but has no effect on client code.
  • Errors objects returned from service errors are now different

    • To migrate your code, see the upgrade guide for the new error structure
  • Network responses received in callback function may now have different structures (results and errors). Requests no longer return a Stream.

    • See the UPGRADE-4.0.md file for more information.
  • personality-insights: Personality Insights v2 is no longer available in the SDK

    • To migrate your code, use Personality Insights v3:
  • compare-comply: Parameter model_id has been changed to model for the following methods: convertToHtml, classifyElements, extractTables, compareDocuments, deleteFeedback, getFeedback, createBatch, and updateBatch

  • speech-to-text: Deprecated methods in Speech to Text are no longer available. Changed parameter names are no longer interally corrected.

  • text-to-speech: Deprecated methods in Text to Speech are no longer available. Changed parameter names are no longer interally corrected.

  • visual-recognition: Deprecated methods in Visual Recognition are no longer available. Changed parameter names are no longer interally corrected.

  • tone-analyzer: Deprecated methods in Tone Analyzer are no longer available. Changed parameter names are no longer interally corrected.

  • personality-insights-v3: Deprecated methods in Personality Insights v3 are no longer available. Changed parameter names are no longer interally corrected.

  • natural-language-understanding: The version_date parameter in Natural Language Understanding is no longer supported.

    • To migrate your code, use the parameter name version instead.
  • natural-language-classifier: Deprecated methods in Natural Language Classifier are no longer available. Changed parameter names are no longer interally corrected.

  • discovery: Deprecated methods in Discovery are no longer available. Changed parameter names are no longer interally corrected.

  • conversation: The Conversation service will no longer be available

    • To migrate your code, use the Assistant v1 or v2 service.
  • language-translator-v2: The Language Translator V2 service will no longer be available

    • To migrate your code, use the Language Translator V3 service.
  • dialog: The Dialog service will no longer be available

    • To migrate your code, use the Assistant v1 or v2 service.
  • Support for the api_key parameter has been removed.

    • For instances of Visual Recognition, use iam_apikey to authenticate.
  • discovery: The name of the model QueryResultResultMetadata has been changed to QueryResultMetadata

    • To migrate your code, use the model QueryResultMetadata instead of QueryResultResultMetadata:

3.18.4 (2019-03-28)

Bug Fixes

  • allow users to use iam_apikey when authenticating for icp (cdccbc1)

3.18.3 (2019-03-19)

Bug Fixes

  • expose token manager from core code as a module (4376e7c)

3.18.2 (2019-03-15)

Bug Fixes

  • make access_token an allowable query parameter in recognize / synthesize streams (a2ad09e)

3.18.1 (2019-02-14)

Bug Fixes

  • use dotenv v5 to maintain node 4.x compatibility (c311651)

3.18.0 (2019-02-06)

Features

  • compare-comply: new constants and new model properties added (d9dc7cc)
  • discovery: add method getStopwordListStatus (ea9eaf9)
  • speech-to-text: optional parameter force added to the method upgradeAcousticModel (ceaa843)

3.17.0 (2019-02-04)

Features

  • enable reading credentials from ibm-credentials.env file (ce02aa8)

3.16.1 (2019-01-19)

Bug Fixes

  • fix getTransactionId method for the RecognizeStream class (e5bbe2c)

3.16.0 (2019-01-17)

Features

  • discovery: add methods createStopwordList, deleteStopwordList, createGateway, deleteGateway, getGateway, and listGateways (8a6753e)
  • speech-to-text: new methods added: addGrammar, deleteGrammar, getGrammar, listGrammars (7ab567a)
  • visual-recognition: parameter accept_language added to method detectFaces (82190c7)

3.15.4 (2019-01-15)

Bug Fixes

  • fix bug that prevents audio from being sent as a buffer for recognize (3f97b80)

3.15.3 (2019-01-15)

Bug Fixes

  • package.json to reduce vulnerabilities (e61d1de)

3.15.2 (2019-01-14)

Bug Fixes

  • query parameters no longer cause text-to-speech over websockets to crash (775e6d2)
  • Remove the disabled property from CreateDialogNode. It is for internal use only. (4b72d0e)

3.15.1 (2019-01-07)

Bug Fixes

  • add disabled property to CreateDialogNode (41cd8dc)
  • add user_defined property to MessageOutput model (ea28bf3)

3.15.0 (2018-12-07)

Features

  • add support for Compare and Comply service (fa22ae5)
  • discovery: adds new model, RetrievalDetails (1821719)
  • natural-language-understanding: new properties added to models to match the service (3bf1e5e)

3.14.0 (2018-12-06)

Features

  • text-to-speech: add support for using synthesize over a websocket connection (94ba896)

3.13.1 (2018-11-26)

Bug Fixes

  • discovery: update mis-defined parameters to match the service (d1fb9a9)
  • speech-to-text: content_type is no longer a required parameter for recognize() or createJob() (it is now optional) (d64c06a)
  • speech-to-text: add support for language_customization_id parameter to the WebSockets method, deprecate customization_id (bf2cd68)

3.13.0 (2018-10-30)

Features

  • discovery: add new methods: createTokenizationDictionary, deleteTokenizationDictionary, and getTokenizationDictionaryStatus (d5ba660)

3.12.0 (2018-10-10)

Features

  • discovery: new parameters added to match updates to the service (838b044)

3.11.1 (2018-09-28)

Bug Fixes

  • icp: disabling ssl verification now works for websocket connection (f8466c8)

3.11.0 (2018-09-24)

Features

  • add support for assistant v2 (8a99676)

3.10.0 (2018-09-13)

Features

  • new languages models supported for speech to text (a2669dd)
  • support authenticating with ibm cloud private (0d1774c)

3.9.1 (2018-08-30)

Bug Fixes

  • add an optional filename parameter for methods accepting a file (9a6cb59)

3.9.0 (2018-08-15)

Features

  • regenerate: add methods for new discovery metrics endpoints (f396eca)

3.8.0 (2018-08-07)

Features

  • regenerate service sdks 7/30/18 (0f95a92)

Version 3.7.0

7/12/18

  • Operations added for Credentials resource (Discovery)

Version 3.6.0

7/11/18

  • Support base_model_version parameter in recognize() (Speech-to-Text)
  • Authentication service now supports returning IAM tokens

Version 3.5.1

6/25/18

  • Fixes bug retrieving Assistant credentials from VCAP services
  • Fixes bug that prevented IAM authentication with Speech to Text websockets

Version 3.5.0

6/12/18

  • Support for Language Translator V3

Version 3.4.5

6/4/18

  • Fixes bug for Visual Recognition service that caused authentication errors when reading credentials from VCAP Services or environment files

Version 3.4.3

5/31/18

Version 3.4.2

5/18/18

  • Updates dependencies to remove security vulnerability
  • Adds methods deleteUserData to Assistant, Conversation, and Discovery

Version 3.4.1

5/3/18

  • Updates dependencies to be compatible with Node v10

Version 3.4.0

4/26/18

Version 3.3.0

4/5/18

  • Visual Recognition

    • New method getCoreMlModel adds support for CoreML
    • Breaking: detectFaces no longer supports identity information in the response.
      • name, score, type_hierarchy removed from response Release notes
  • Natural Language Classifier

    • New method 'classifyCollection`

Conversation/Assistant

  • timestamp parameters created and updated are optional, not required
  • context parameter is optional in message

Version 3.2.1

3/15/18

  • Renames Assistant from v1-generated to v1

Version 3.2.0

3/15/18

  • Adds Assistant Service (Conversation has been renamed to Assistant)

Version 3.1.1

3/8/18

  • Adds warnings to methods with changed names
  • Ensures that new parameters are passed into methods when calling them using the older format used in the adapters.

Version 3.1.0

3/7/18

Breaking changes:

Speech to text

  • param audio is now required in recognize method
  • methods createSession, deleteSession, getSessionStatus deprecated

Non Breaking:

  • All code is regenerated to reflect the newest versions of all services
  • Methods with exclusively text/plain body parameters now are correctly generated
  • Fixes linting in build
    • Adds new linter, tslint for typescript files

SpeechToText:

  • addAudio method: param audio_resource is now type ReadableStream|FileObject|Buffer instead of ByteArray[]
  • transfer-encoding is removed from recognize method

Conversation

  • include_audit parameters are now supported
  • node_visited_details is now supported

Tone Analyzer

  • Adds support for content_language for tone_chat endpoint

Visual Recognition

  • Items in ‘parameters’ are now top level params

v3.0.7

  • services use version instead of version_date and should pass in dates directly such as '2017-02-27' instead of calling date constants.

v3.0.6

  • All .ts files are removed from the npm package
  • Fixes issue of enforcing our typescript compiler settings when other typescript projects use our package
  • All instances of ReadableStream changed to NodeJs.ReadableStream, blob type added to /lib/, both changes done to correctly link these types for typescript users

v3.0.5

  • [User-Agent] in header is no longer overwritten but instead appended, this change only affects metrics of this SDK

v3.0.4

  • Fixed bug in visual recognition to correctly use owners parameter
  • Fixed bug in NLU where environment variables storing credentials were not read when running locally
  • Dependencies updated to fix security vulnerabilities

v3.0.3

  • Added support for customization_weight or acoustic_customization_id in speech-to-text/v1

Version 3.0

2017-11-29

This version contains several breaking changes.

Version 3.0 introduces automatically generated client code. The client code is generated from Swagger. Several deprecated services have been removed from this release. Furthermore, language has been changed from NodeJS to TypeScript, and file extensions have been changed from *.js to *.ts

Services that are not affected in this release:

  • Authorization
  • Dialog

Services that are affected in this release:

  • Conversation
  • Discovery
  • Language Translator
  • Natural Language Classifier
  • Natural Language Understanding
  • Personality Insights
  • Text to Speech
  • Tone Analyzer
  • Speech to Text
  • Visual Recognition

Services that are removed in this release:

  • Alchemy Language
  • Alchemy Data News
  • Document Conversion
  • Retrieve and Rank
  • Tradeoff Analytics

Upon upgrading the SDK, follow the migration guide here.

v2.39.0

  • Added support for highlight param in DiscoveryV1.query()

v2.38.0

  • DiscoveryV1.VERSION_DATE_2017_08_01 = '2017-08-01';

v2.37.0

  • ToneAnalyzerV3.tone() now accepts language parameter to specify content-language header for input.

v2.36.1

  • Improved formatting of Alchemy Language error messages

v2.36.0

  • Added ConversationV1.VERSION_DATE_2017_05_26

v2.35.0

  • Added DiscoveryV1.updateJsonDocument to complimentaddJsonDocument()

v2.34.0

  • Added DiscoveryV1.addJsonDocument() method to make uploading in-memory JSON structures easier
  • Fixed bug in DiscoveryV1.addDocument() that prevented setting custom filenames #474

v2.33.0

  • Added support for fuzzy_match param in Conversation entities methods
  • Added support for JSON metadata when adding documents to Discovery #474

v2.32.1

  • Discovery: fix createEnv with size 0

v2.32.0

v2.31.2

  • Bumped solr-client dependency to latest version

v2.31.1

  • Added VisualRecognitionV3.VERSION_DATE_2016_05_20 constant

v2.31.0

  • Added support for sort param on DiscoveryV1.query() (#446)
  • Added DiscoveryV1.VERSION_DATE_2017_04_27
  • Made utterances a top-level param for ToneAnalyzerV3.tone_chat() (#439)

v2.30.0

  • Added support for Conversation entities (w/ values and synonyms) and logs
  • Added support for updating Discovery environments

v2.29.0

  • Added tone_chat endpoint for Tone Analyzer
  • Added support for WebM and Ogg/Vorbis formats to Speech to Text

v2.28.1

  • Fixed Visual Recognition credentials in dedicated environments (#436)

v2.28.0

  • bumped vcap_services library version
  • Fixed bug with STT async recognition & multiple callback events
  • Moved changelog to wiki

v2.27.1

  • Fixed issue when creating STT Async recognize job with multiple callback events (#415)

v2.27.0

  • Add support for Conversation Counter Examples API

v2.26.1

  • Correct name of events parameter in STT async recognize.

v2.26.0

  • Conversation sorting and pagination for workspaces, intents, and examples

v2.25.1

  • Natural Language Understanding: fixed credentials pulling from bluemix

v2.25.0

  • Natural Language Understanding: new version_date and addition of listModels() and deleteModel() methods

v2.24.1

  • STT RecognizeStream now exposes Transaction ID

v2.23.1

  • Restored support for Node.js 4.0-4.4

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

  • Speech to Text Asychronous API support

v2.21.0

  • Added support for sort paramater in SpeechToTextV1.getWords()
  • Added updateDocument() method to DiscoveryV1
  • Fixed up internal code to avoid using the deprecated new Buffer(...) API
  • Improved documentation

v2.20.0

  • Conversation VersionDate 2017-02-03

v2.19.0

  • Added support for find_preferable_options flag in Tradeoff Analytics

v2.18.0

  • Added various methods to Conversation service to create and manage workspaces
  • Prevent docs site files from being included in npm releases

v2.17.1

  • Fixed bug in STT getWords method (#390)

v2.17.0

  • No API changes, but significant internal changes. Should behave exactly the same, but releasing as a standalone version out of caution.

v2.16.0

  • Added NaturalLanguageUnderstandingV1
  • Added support for pulling SERVICE_NAME_URL from enviroment properties along with username and password (or api key)

v2.15.5

  • stt.whenCustomizationReady() no longer incorrectly requires that a corpus be added. (#382)
  • various JSDoc corrections

v2.15.2

  • Fix slightly-incorrect URL in Language Translator V2 example and error message

v2.15.0

  • SDK now emits missing parameter errors on returned stream if no callback is supplied (#368 / #377)

v2.14.8

  • Fix DocumentConversion#convert() to accept config params as documented in api ref
  • Fix param checking on various TTS customization methods

v2.14.6

  • Fix incorrect error messages (#373)

v2.14.5

  • Fix issue where adding a document as buffer/string fails in Discovery v1 (#370)
  • Fix issue where STT RecognizeStream could fail to emit speaker_labels event in rare circumstances

v2.14.4

  • Update jsdoc for Speech to text

v2.14.3

  • Expose discovery v1 in index

v2.14.2

  • Same fix for language translation

v2.14.7

  • Fixed DocumentConversionV1.convert() to accept config params as a seperate object, matching api ref documentation (#375)

v2.14.6

  • Fix regression in error handler that would incorrectly overwrite error message in some cases

v2.14.5

  • Fix isue where STT RecognizeStream could fail to emit a speaker_labels events in certain rare circumstances
  • Added Discovery add createEnvironment and deleteEnvironment methods
  • Fix Discovery addDocument when adding a Buffer

v2.14.4

  • Update JSDOc for speech to Text

v2.14.3

  • Expose discovery v1 in index.js

v2.14.2

  • Fix content type for language translation (#362)

v2.14.1

  • Fix content type for language translator (#362)

v2.14.0

  • Added Discovery V1 (general availability release)

v2.13.0

  • Added STT whenCorporaAnalyzed() helper, #353
  • Bumped dependencies

v2.12.0

  • Added Speech to Text speaker_labels support, added new speaker_labels event to RecognizeStream

v2.11.1

  • Fixed main file path in package.json
  • added a conversation example

v2.11.0

  • Added several methods and a version_date constant to DiscoveryV1Experimental

v2.10.1

  • Added version_date constants to ConversationV1, updated docs, examples, etc to latest version_date.

v2.9.1

  • Added customization_id support to STT RecognizeStream

v2.9.0

  • Allow VisualRecognitionV3.classify() to accept Buffers (with automatic content-type detection) or Objects with specified filename or content-type
  • Improve Visual Recognition error formatting
  • Document Conversion: Remove forced utf-8 charset header for html files

v2.8.3

  • Fixed issue with formatting multiple keywords for STT recognize() - #261

v2.8.1

  • Added getCredentials() method to base service, primarily for use with AuthorizationV1()

v2.7.1

  • dependency fix

v2.7.0

  • Speech to Text customization support

v2.6.1

  • Ensure errors are always instanceof Error
  • Doc improvements

v2.6.0

  • Added support for Personality Insights V3

v2.5.0

  • Split LanguageTranslationV2 into a seperate service from LanguageTranslatorV2, added a warning when translator service is used without specifying a url since the default is currently incorrect.
  • Fixed bug with setting user-agent header

v2.4.7

  • Fixed issue with send data on non-open WebSockets for STT RecognizeStream - see #322

v2.4.6

  • Fixed credential bugs in R&R and STT

v2.4.5

  • Fixed bug where credentials could be lost when calling certain methods in Language Translator and Dialog services

v2.4.4

  • Doc-only changes, focused on Language Translation/Translator differences and temporary workaround

v2.4.3

  • Fix issue with automatically loading Alchemy* credentials from the Bluemix environment

v2.4.1

  • Revert part of credential change: Alchemy* services again use apikey while visual recognition uses api_key (Most endpoints accept either, but this split follows the documented API for each service.)

v2.4.0

  • Added support for Visual Recognition similarity search beta
  • Refactored handling of credentials to support constraints in similarity search

v2.3.0

  • Add support for RetrieveAndRankV1.rank() answers param

v2.2.0

  • Added support for creating and managing TTS Customizations

v2.1.3

  • Deprecation warning for Dialog
  • Added TTS .voice() and .pronunciation() methods
  • Added support for customization_id to existing TTS methods
  • Typo and JSDoc fixes
  • Fixed bug with pulling api key from env properties for alchemy services

v2.1.2

  • Added profanity_filter support to STT RecognizeStream

v2.1.1

  • Corrected some examples to use - instead of _
  • Renamed NLC folder to use - instead of _

v2.1.0

  • Updated AlchemyLanguageV1.emotion() to support new targeted_emotion parameter & endpoint
  • Added Conversation/Tone Analyzer integration example
  • Updated Readme & Examples to use newer constructor style

v2.0.3

  • Use actual Error instances for errors (#298)

v2.0.2

  • Added support for the intents, entities and output parameters in ConveersationV1.message()
  • Removed sunset services: Concept Insights and Relationship Extraction
  • Dependency bump

v2.0.1

  • Added VisualRecognitionV3.retrainClassifier() to facilitate updating of existing custom classifiers
  • Added support for alternate_intents parameter in ConversationV1.message()

v2.0.0

  • Breaking: prefer programatic (user-supplied) credentials over bluemix-provided ones (VCAP_SERVICES)
  • New preferred method of instantiating services: new watson.PersonalityInsightsV2({/*...*/}); instead of watson.personality_insights({/*...*/});. Older method still works
  • Restructured code to support client-side usage via tools such as Browserify and Webpack. Most services support CORS; this will be documented and the remaining service teams will be nagged.
  • Added a changelog to capture both major breaking changes and smaller

Breaking Changes for v1.0

Several breaking changes were introduced with the v1.0.0 release:

  • Experimental and Beta services now require the appropriate tag to be added to their version:
    • Concept Expansion v1 is now v1-beta
    • Question and Answer v1 is now v1-beta
    • Relationship Extraction v1 is now v1-beta
    • Tone Analyzer v3 is now v3 (latest) or v3-beta (compatibility with old Beta plan)
    • Visual Insights v1 is now v1-experimental
    • Visual Recognition v1 is now v1-beta
  • Speech to Text gained a new createRecognizeStream() method replacing the existing live streaming methods with a simpler Read/Write stream. The older methods are still available in v1.0 but each log a deprecation warning (unless {silent: true} is passed in) and will be removed from a future release. The affected methods are:
    • recognizeLive()
    • observeResult()
    • getRecognizeStatus()
  • The Document Conversion API has been reduced to a single convert() method; it no longer offers batch conversion or cloud storage of files.
  • Several deprecated services have been removed:
    • Message Resonance
    • Tone Analyzer v1 and v2 (replaced by v3)
    • Search (replaced by Retrieve and Rank)
  • Dropped support for node.js v0.10.x (For reference: the WDC Node.js SDK now officially support the latest 0.12, LTS, and Stable releases of Node.js.)