fix missing speech vendor in telemetry metric (#437)

This commit is contained in:
Hoan Luu Huu
2023-08-28 18:45:00 +07:00
committed by GitHub
parent 78fd4549af
commit 7a02c36bad

View File

@@ -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;