From 030eb5f8470882f789e8120c3fbc395258ea7a22 Mon Sep 17 00:00:00 2001 From: Hoan Luu Huu <110280845+xquanluu@users.noreply.github.com> Date: Tue, 2 Apr 2024 06:14:06 +0700 Subject: [PATCH] support google stt version 2 (#49) * support google stt version 2 * fix review comments * fix review comment --- specs.json | 15 +++++++++++++++ test/jambonz-verb-test.js | 21 +++++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/specs.json b/specs.json index 280cbfd..76d3960 100644 --- a/specs.json +++ b/specs.json @@ -646,6 +646,7 @@ "awsOptions": "#awsOptions", "azureOptions": "#azureOptions", "assemblyAiOptions": "#assemblyAiOptions", + "googleOptions": "#googleOptions", "customOptions": "#customOptions" }, "required": [ @@ -698,6 +699,20 @@ "required": [ ] }, + "googleOptions" : { + "properties": { + "serviceVersion": { + "type": "string", + "enum": [ + "v1", + "v2" + ] + }, + "speechStartTimeoutMs": "number", + "speechEndTimeoutMs": "number", + "transcriptNormalization": "array" + } + }, "cobaltOptions": { "properties": { "serverUri": "string", diff --git a/test/jambonz-verb-test.js b/test/jambonz-verb-test.js index 9d9688f..c58b2f3 100644 --- a/test/jambonz-verb-test.js +++ b/test/jambonz-verb-test.js @@ -412,6 +412,27 @@ test("validate correct verbs", async (t) => { "interim": true } }, + { + "verb": "transcribe", + "transcriptionHook": "http://example.com/transcribe", + "recognizer": { + "vendor": "nvidia", + "language" : "en-US", + "interim": true, + "googleOptions": { + "serviceVersion": "v2", + "speechStartTimeoutMs": 500, + "speechEndTimeoutMs": 1000, + "transcriptNormalization" : [ + { + "search": "dog", + "replace": "cat", + "case_sensitive": true + } + ] + } + } + }, { "verb": "rest:dial", "account_sid": "1291964182631236912836123912",