diff --git a/functions/ocr/app/index.js b/functions/ocr/app/index.js index e939d651e3..8f1d7a4bea 100644 --- a/functions/ocr/app/index.js +++ b/functions/ocr/app/index.js @@ -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] diff --git a/functions/ocr/app/package.json b/functions/ocr/app/package.json index 38986b3acd..937f58e7bd 100644 --- a/functions/ocr/app/package.json +++ b/functions/ocr/app/package.json @@ -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" }, diff --git a/functions/speech-to-speech/functions/index.js b/functions/speech-to-speech/functions/index.js index db12b52462..f17e8dfd14 100644 --- a/functions/speech-to-speech/functions/index.js +++ b/functions/speech-to-speech/functions/index.js @@ -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'); diff --git a/functions/speech-to-speech/functions/package.json b/functions/speech-to-speech/functions/package.json index fcb0c1b753..b2f8d4bd38 100644 --- a/functions/speech-to-speech/functions/package.json +++ b/functions/speech-to-speech/functions/package.json @@ -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"