From 7a02c36bad9983ab6474e55689046c2977ef4851 Mon Sep 17 00:00:00 2001 From: Hoan Luu Huu <110280845+xquanluu@users.noreply.github.com> Date: Mon, 28 Aug 2023 18:45:00 +0700 Subject: [PATCH] fix missing speech vendor in telemetry metric (#437) --- lib/utils/transcription-utils.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/utils/transcription-utils.js b/lib/utils/transcription-utils.js index d54a4d91..0817daba 100644 --- a/lib/utils/transcription-utils.js +++ b/lib/utils/transcription-utils.js @@ -225,12 +225,17 @@ const normalizeGoogle = (evt, channel, language) => { }; }; -const normalizeCustom = (evt, channel, language) => { +const normalizeCustom = (evt, channel, language, vendor) => { + const copy = JSON.parse(JSON.stringify(evt)); return { language_code: language, channel_tag: channel, is_final: evt.is_final, - alternatives: [evt.alternatives[0]] + alternatives: [evt.alternatives[0]], + vendor: { + name: vendor, + evt: copy + } }; }; @@ -314,7 +319,7 @@ module.exports = (logger) => { return normalizeSoniox(evt, channel, language); default: if (vendor.startsWith('custom:')) { - return normalizeCustom(evt, channel, language); + return normalizeCustom(evt, channel, language, vendor); } logger.error(`Unknown vendor ${vendor}`); return evt;