mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-20 08:40:38 +00:00
google STT: when altLanguges are used default to a model that supports it
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
const {
|
||||
TaskName,
|
||||
AzureTranscriptionEvents,
|
||||
GoogleTranscriptionEvents,
|
||||
AwsTranscriptionEvents,
|
||||
@@ -335,6 +336,11 @@ module.exports = (logger) => {
|
||||
};
|
||||
|
||||
if ('google' === vendor) {
|
||||
const altLanguages = [...new Set(rOpts.altLanguages)];
|
||||
let model = 'phone_call';
|
||||
if (altLanguages.length) {
|
||||
model = task.name === TaskName.Gather ? 'command_and_search' : 'latest_long';
|
||||
}
|
||||
opts = {
|
||||
...opts,
|
||||
...(sttCredentials && {GOOGLE_APPLICATION_CREDENTIALS: JSON.stringify(sttCredentials.credentials)}),
|
||||
@@ -363,7 +369,7 @@ module.exports = (logger) => {
|
||||
{GOOGLE_SPEECH_ALTERNATIVE_LANGUAGE_CODES: [...new Set(rOpts.altLanguages)].join(',')}),
|
||||
...(rOpts.interactionType &&
|
||||
{GOOGLE_SPEECH_METADATA_INTERACTION_TYPE: rOpts.interactionType}),
|
||||
...{GOOGLE_SPEECH_MODEL: rOpts.model || 'phone_call'},
|
||||
...{GOOGLE_SPEECH_MODEL: rOpts.model || model},
|
||||
...(rOpts.naicsCode > 0 && {GOOGLE_SPEECH_METADATA_INDUSTRY_NAICS_CODE: rOpts.naicsCode}),
|
||||
GOOGLE_SPEECH_METADATA_RECORDING_DEVICE_TYPE: 'phone_line',
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user