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;