Skip to content

Commit 6478da6

Browse files
feat(lt): remove lt and other deprecated resources
BREAKING CHANGE: LanguageTranslator functionality has been removed
1 parent 936edc1 commit 6478da6

21 files changed

+18
-3017
lines changed

.github/workflows/integration-test.yml

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -35,31 +35,16 @@ jobs:
3535
- name: Execute Node integration tests
3636
# continue-on-error: true
3737
env:
38-
NATURAL_LANGUAGE_CLASSIFIER_URL: "https://api.us-south.natural-language-classifier.watson.cloud.ibm.com"
39-
NATURAL_LANGUAGE_CLASSIFIER_APIKEY: ${{ secrets.NLC_APIKEY }}
40-
NATURAL_LANGUAGE_CLASSIFIER_ID: ${{ secrets.NLC_CLASSIFIER_ID }}
4138
ASSISTANT_URL: "https://api.us-south.assistant.watson.cloud.ibm.com"
4239
ASSISTANT_APIKEY: ${{ secrets.WA_APIKEY }}
4340
ASSISTANT_WORKSPACE_ID: ${{ secrets.WA_WORKSPACE_ID }}
4441
ASSISTANT_ASSISTANT_ID: ${{ secrets.WA_ASSISTANT_ID }}
45-
COMPARE_COMPLY_URL: "https://api.us-south.compare-comply.watson.cloud.ibm.com"
46-
COMPARE_COMPLY_APIKEY: ${{ secrets.CC_APIKEY }}
47-
COMPARE_COMPLY_FEEDBACK_ID: ${{ secrets.CC_FEEDBACK_ID }}
48-
LANGUAGE_TRANSLATOR_URL: "https://api.us-south.language-translator.watson.cloud.ibm.com"
49-
LANGUAGE_TRANSLATOR_APIKEY: ${{ secrets.LT_APIKEY }}
5042
NATURAL_LANGUAGE_UNDERSTANDING_URL: "https://api.us-south.natural-language-understanding.watson.cloud.ibm.com"
5143
NATURAL_LANGUAGE_UNDERSTANDING_APIKEY: ${{ secrets.NLU_APIKEY }}
52-
PERSONALITY_INSIGHTS_URL: "https://api.us-south.personality-insights.watson.cloud.ibm.com"
53-
PERSONALITY_INSIGHTS_APIKEY: ${{ secrets.PI_APIKEY }}
5444
SPEECH_TO_TEXT_URL: "https://api.us-south.speech-to-text.watson.cloud.ibm.com"
5545
SPEECH_TO_TEXT_APIKEY: ${{ secrets.STT_APIKEY }}
5646
TEXT_TO_SPEECH_URL: "https://api.us-south.text-to-speech.watson.cloud.ibm.com"
5747
TEXT_TO_SPEECH_APIKEY: ${{ secrets.TTS_APIKEY }}
58-
TONE_ANALYZER_URL: "https://api.us-south.tone-analyzer.watson.cloud.ibm.com"
59-
TONE_ANALYZER_APIKEY: ${{ secrets.TA_APIKEY }}
60-
VISUAL_RECOGNITION_URL: "https://api.us-south.visual-recognition.watson.cloud.ibm.com"
61-
VISUAL_RECOGNITION_APIKEY: ${{ secrets.VR_APIKEY }}
62-
VISUAL_RECOGNITION_COLLECTION_ID: ${{ secrets.VR_COLLECTION_ID }}
6348
DISCOVERY_V2_URL: "https://api.us-south.discovery.watson.cloud.ibm.com"
6449
DISCOVERY_V2_APIKEY: ${{ secrets.D2_APIKEY }}
6550
DISCOVERY_V2_PROJECT_ID: ${{ secrets.D2_PROJECT_ID }}
@@ -70,7 +55,6 @@ jobs:
7055
jest --silent --coverage=false --runInBand --no-colors --testNamePattern='^((?!@slow).)*$' test/integration/assistant.v1.test.js
7156
jest --silent --coverage=false --runInBand --no-colors --testNamePattern='^((?!@slow).)*$' test/integration/assistant.v2.test.js
7257
jest --silent --coverage=false --runInBand --no-colors --testNamePattern='^((?!@slow).)*$' test/integration/discovery.v2.test.js
73-
jest --silent --coverage=false --runInBand --no-colors --testNamePattern='^((?!@slow).)*$' test/integration/language-translator.v3.test.js
7458
jest --silent --coverage=false --runInBand --no-colors --testNamePattern='^((?!@slow).)*$' test/integration/speech-to-text.test.js
7559
jest --silent --coverage=false --runInBand --no-colors --testNamePattern='^((?!@slow).)*$' test/integration/text-to-speech.test.js
7660

.gitignore

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@ coverage
66
test/resources/auth.js
77
test/resources/-auth.js # to make sure tests run without the auth file
88
test/resources/tts-output.ogg
9-
test/resources/visual_recognition.prepop/images
10-
test/resources/cc_input_auth_file.json
11-
test/resources/cc_output_auth_file.json
129
test/resources/secrets.tar
1310
.idea
1411
doc/
@@ -22,17 +19,11 @@ lib/*.js
2219
conversation/*.js
2320
dialog/*.js
2421
discovery/*.js
25-
language-translator/*.js
26-
natural-language-classifier/*.js
2722
natural-language-understanding/*.js
28-
personality-insights/*.js
29-
tone-analyzer/*.js
30-
visual-recognition/*.js
3123
text-to-speech/*.js
3224
speech-to-text/*.js
3325
authorization/*.js
3426
assistant/*.js
35-
compare-comply/*.js
3627
iam-token-manager/*.js
3728
index.js
3829
sdk.js

examples/browserify/README.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,9 @@ and in some cases, certain methods work while others do not. Below is a partial
1414

1515
The following services support CORS
1616

17-
- Tone Analyzer
1817
- Speech to Text\*
1918
- Text to Speech\*
20-
- Personality Insights
21-
- Visual Recognition
2219
- Natural Language Understanding
2320
- Watson Assistant
2421

2522
\* Speech to Text and Text to Speech should be usable via the Node.js SDK, but we also have a [Speech JavaScript SDK](https://www.npmjs.com/package/watson-speech) that was specifically written for browser support.
26-
27-
The following services do not support CORS
28-
29-
- Language Translator

examples/browserify/public/client.js

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,11 @@
1111
//
1212
// * fetch() is a modern version of XMLHttpRequest. A pollyfill is available for older browsers: https://github.com/github/fetch
1313

14-
const ToneAnalyzerV3 = require('ibm-watson/tone-analyzer/v3');
14+
const TextToSpeechV1 = require('ibm-watson/text-to-speech/v1');
1515
const { BearerTokenAuthenticator } = require('ibm-watson/auth');
16+
const fs = require('fs');
1617

1718
const btn = document.getElementById('analyze-btn');
18-
const input = document.getElementById('input');
19-
const output = document.getElementById('output');
2019

2120
/**
2221
* @return {Promise<String>} returns a promise that resolves to a string token
@@ -26,23 +25,28 @@ function getToken() {
2625
}
2726

2827
function analyze(credentials) {
29-
const toneAnalyzer = new ToneAnalyzerV3({
28+
const textToSpeech = new TextToSpeechV1({
3029
authenticator: new BearerTokenAuthenticator({
3130
bearerToken: credentials.accessToken,
3231
}),
3332
url: credentials.url,
34-
version: '2016-05-19',
33+
version: '2023-03-31',
3534
});
36-
toneAnalyzer
37-
.tone({
38-
toneInput: { text: input.value },
39-
contentType: 'application/json',
40-
})
41-
.then(({ result }) => {
42-
output.innerHTML = JSON.stringify(result, null, 2);
35+
36+
const synthesizeParams = {
37+
text: 'Hello from IBM Watson',
38+
accept: 'audio/mp3',
39+
voice: 'en-US_AllisonVoice',
40+
};
41+
42+
textToSpeech
43+
.synthesize(synthesizeParams)
44+
.then(response => {
45+
const audio = response.result;
46+
audio.pipe(fs.createWriteStream('hello_world.mp3'));
4347
})
44-
.catch(error => {
45-
output.innerHTML = error;
48+
.catch(err => {
49+
console.log('error:', err);
4650
});
4751
}
4852

examples/language_translator.v3.js

Lines changed: 0 additions & 20 deletions
This file was deleted.

0 commit comments

Comments
 (0)