Skip to content

Commit

Permalink
Updates speech-to-speech and ocr-app samples. (#1532)
Browse files Browse the repository at this point in the history
* Updates [google-cloud/translate][1] dependency to version `5.0.0`.
* Updates declaration of clients to specify the version 2 of the API instead of
the version 3, which is the default in the Translate library.

Note: The google-cloud/translate library made v3 the default in googleapis/nodejs-translate#355

[1]: https://github.com/googleapis/nodejs-translate
  • Loading branch information
ricalo authored and fhinkel committed Oct 30, 2019
1 parent 2f0ac35 commit 3aa32fb
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion functions/ocr/app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const Vision = require('@google-cloud/vision');
const vision = new Vision.ImageAnnotatorClient();

// Get a reference to the Translate API component
const {Translate} = require('@google-cloud/translate');
const {Translate} = require('@google-cloud/translate').v2;
const translate = new Translate();

// [END functions_ocr_setup]
Expand Down
2 changes: 1 addition & 1 deletion functions/ocr/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"dependencies": {
"@google-cloud/pubsub": "^1.0.0",
"@google-cloud/storage": "^4.0.0",
"@google-cloud/translate": "^4.0.0",
"@google-cloud/translate": "^5.0.0",
"@google-cloud/vision": "^1.0.0",
"nconf": "^0.10.0"
},
Expand Down
2 changes: 1 addition & 1 deletion functions/speech-to-speech/functions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const voiceSsmlGender = 'NEUTRAL';

// Declare the API clients as global variables to allow them to initiaze at cold start.
const {SpeechClient} = require('@google-cloud/speech');
const {Translate} = require('@google-cloud/translate');
const {Translate} = require('@google-cloud/translate').v2;
const {TextToSpeechClient} = require('@google-cloud/text-to-speech');
const {Storage} = require('@google-cloud/storage');

Expand Down
2 changes: 1 addition & 1 deletion functions/speech-to-speech/functions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"@google-cloud/speech": "^3.0.0",
"@google-cloud/storage": "^4.0.0",
"@google-cloud/text-to-speech": "^1.0.0",
"@google-cloud/translate": "^4.0.0",
"@google-cloud/translate": "^5.0.0",
"uuid": "^3.3.2",
"firebase-admin": "^8.0.0",
"firebase-functions": "^3.0.0"
Expand Down

0 comments on commit 3aa32fb

Please sign in to comment.