Skip to content

Commit

Permalink
feat(lt): remove lt and other deprecated resources
Browse files Browse the repository at this point in the history
BREAKING CHANGE: LanguageTranslator functionality has been removed
  • Loading branch information
apaparazzi0329 committed Dec 4, 2024
1 parent 936edc1 commit 6478da6
Show file tree
Hide file tree
Showing 21 changed files with 18 additions and 3,017 deletions.
16 changes: 0 additions & 16 deletions .github/workflows/integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,31 +35,16 @@ jobs:
- name: Execute Node integration tests
# continue-on-error: true
env:
NATURAL_LANGUAGE_CLASSIFIER_URL: "https://api.us-south.natural-language-classifier.watson.cloud.ibm.com"
NATURAL_LANGUAGE_CLASSIFIER_APIKEY: ${{ secrets.NLC_APIKEY }}
NATURAL_LANGUAGE_CLASSIFIER_ID: ${{ secrets.NLC_CLASSIFIER_ID }}
ASSISTANT_URL: "https://api.us-south.assistant.watson.cloud.ibm.com"
ASSISTANT_APIKEY: ${{ secrets.WA_APIKEY }}
ASSISTANT_WORKSPACE_ID: ${{ secrets.WA_WORKSPACE_ID }}
ASSISTANT_ASSISTANT_ID: ${{ secrets.WA_ASSISTANT_ID }}
COMPARE_COMPLY_URL: "https://api.us-south.compare-comply.watson.cloud.ibm.com"
COMPARE_COMPLY_APIKEY: ${{ secrets.CC_APIKEY }}
COMPARE_COMPLY_FEEDBACK_ID: ${{ secrets.CC_FEEDBACK_ID }}
LANGUAGE_TRANSLATOR_URL: "https://api.us-south.language-translator.watson.cloud.ibm.com"
LANGUAGE_TRANSLATOR_APIKEY: ${{ secrets.LT_APIKEY }}
NATURAL_LANGUAGE_UNDERSTANDING_URL: "https://api.us-south.natural-language-understanding.watson.cloud.ibm.com"
NATURAL_LANGUAGE_UNDERSTANDING_APIKEY: ${{ secrets.NLU_APIKEY }}
PERSONALITY_INSIGHTS_URL: "https://api.us-south.personality-insights.watson.cloud.ibm.com"
PERSONALITY_INSIGHTS_APIKEY: ${{ secrets.PI_APIKEY }}
SPEECH_TO_TEXT_URL: "https://api.us-south.speech-to-text.watson.cloud.ibm.com"
SPEECH_TO_TEXT_APIKEY: ${{ secrets.STT_APIKEY }}
TEXT_TO_SPEECH_URL: "https://api.us-south.text-to-speech.watson.cloud.ibm.com"
TEXT_TO_SPEECH_APIKEY: ${{ secrets.TTS_APIKEY }}
TONE_ANALYZER_URL: "https://api.us-south.tone-analyzer.watson.cloud.ibm.com"
TONE_ANALYZER_APIKEY: ${{ secrets.TA_APIKEY }}
VISUAL_RECOGNITION_URL: "https://api.us-south.visual-recognition.watson.cloud.ibm.com"
VISUAL_RECOGNITION_APIKEY: ${{ secrets.VR_APIKEY }}
VISUAL_RECOGNITION_COLLECTION_ID: ${{ secrets.VR_COLLECTION_ID }}
DISCOVERY_V2_URL: "https://api.us-south.discovery.watson.cloud.ibm.com"
DISCOVERY_V2_APIKEY: ${{ secrets.D2_APIKEY }}
DISCOVERY_V2_PROJECT_ID: ${{ secrets.D2_PROJECT_ID }}
Expand All @@ -70,7 +55,6 @@ jobs:
jest --silent --coverage=false --runInBand --no-colors --testNamePattern='^((?!@slow).)*$' test/integration/assistant.v1.test.js
jest --silent --coverage=false --runInBand --no-colors --testNamePattern='^((?!@slow).)*$' test/integration/assistant.v2.test.js
jest --silent --coverage=false --runInBand --no-colors --testNamePattern='^((?!@slow).)*$' test/integration/discovery.v2.test.js
jest --silent --coverage=false --runInBand --no-colors --testNamePattern='^((?!@slow).)*$' test/integration/language-translator.v3.test.js
jest --silent --coverage=false --runInBand --no-colors --testNamePattern='^((?!@slow).)*$' test/integration/speech-to-text.test.js
jest --silent --coverage=false --runInBand --no-colors --testNamePattern='^((?!@slow).)*$' test/integration/text-to-speech.test.js
Expand Down
9 changes: 0 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ coverage
test/resources/auth.js
test/resources/-auth.js # to make sure tests run without the auth file
test/resources/tts-output.ogg
test/resources/visual_recognition.prepop/images
test/resources/cc_input_auth_file.json
test/resources/cc_output_auth_file.json
test/resources/secrets.tar
.idea
doc/
Expand All @@ -22,17 +19,11 @@ lib/*.js
conversation/*.js
dialog/*.js
discovery/*.js
language-translator/*.js
natural-language-classifier/*.js
natural-language-understanding/*.js
personality-insights/*.js
tone-analyzer/*.js
visual-recognition/*.js
text-to-speech/*.js
speech-to-text/*.js
authorization/*.js
assistant/*.js
compare-comply/*.js
iam-token-manager/*.js
index.js
sdk.js
Expand Down
7 changes: 0 additions & 7 deletions examples/browserify/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,9 @@ and in some cases, certain methods work while others do not. Below is a partial

The following services support CORS

- Tone Analyzer
- Speech to Text\*
- Text to Speech\*
- Personality Insights
- Visual Recognition
- Natural Language Understanding
- Watson Assistant

\* 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.

The following services do not support CORS

- Language Translator
32 changes: 18 additions & 14 deletions examples/browserify/public/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,11 @@
//
// * fetch() is a modern version of XMLHttpRequest. A pollyfill is available for older browsers: https://github.com/github/fetch

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

const btn = document.getElementById('analyze-btn');
const input = document.getElementById('input');
const output = document.getElementById('output');

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

function analyze(credentials) {
const toneAnalyzer = new ToneAnalyzerV3({
const textToSpeech = new TextToSpeechV1({
authenticator: new BearerTokenAuthenticator({
bearerToken: credentials.accessToken,
}),
url: credentials.url,
version: '2016-05-19',
version: '2023-03-31',
});
toneAnalyzer
.tone({
toneInput: { text: input.value },
contentType: 'application/json',
})
.then(({ result }) => {
output.innerHTML = JSON.stringify(result, null, 2);

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

textToSpeech
.synthesize(synthesizeParams)
.then(response => {
const audio = response.result;
audio.pipe(fs.createWriteStream('hello_world.mp3'));
})
.catch(error => {
output.innerHTML = error;
.catch(err => {
console.log('error:', err);
});
}

Expand Down
20 changes: 0 additions & 20 deletions examples/language_translator.v3.js

This file was deleted.

Loading

0 comments on commit 6478da6

Please sign in to comment.