mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-20 08:40:38 +00:00
support google version 2 (#699)
* support google version 2 * update new parameters for google v2
This commit is contained in:
@@ -487,14 +487,10 @@ module.exports = (logger) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
if ('google' === vendor) {
|
if ('google' === vendor) {
|
||||||
const model = task.name === TaskName.Gather ? 'command_and_search' : 'latest_long';
|
const useV2 = rOpts.googleOptions?.serviceVersion === 'v2';
|
||||||
/**
|
const model = task.name === TaskName.Gather ?
|
||||||
* When we support google v2 the models are different and we will want something like:
|
(useV2 ? 'telephony_short' : 'command_and_search') :
|
||||||
* const useV2 = sttCredentials?.credentials?.project_id; //TODO: v2 pref should be set in googleOptions
|
(useV2 ? 'long' : 'latest_long');
|
||||||
* const model = task.name === TaskName.Gather ?
|
|
||||||
* (useV2 ? 'telephony_short' : 'command_and_search') :
|
|
||||||
* (useV2 ? 'long' : 'latest_long');
|
|
||||||
*/
|
|
||||||
opts = {
|
opts = {
|
||||||
...opts,
|
...opts,
|
||||||
...(sttCredentials && {GOOGLE_APPLICATION_CREDENTIALS: JSON.stringify(sttCredentials.credentials)}),
|
...(sttCredentials && {GOOGLE_APPLICATION_CREDENTIALS: JSON.stringify(sttCredentials.credentials)}),
|
||||||
@@ -527,12 +523,19 @@ module.exports = (logger) => {
|
|||||||
...{GOOGLE_SPEECH_MODEL: rOpts.model || model},
|
...{GOOGLE_SPEECH_MODEL: rOpts.model || model},
|
||||||
...(rOpts.naicsCode > 0 && {GOOGLE_SPEECH_METADATA_INDUSTRY_NAICS_CODE: rOpts.naicsCode}),
|
...(rOpts.naicsCode > 0 && {GOOGLE_SPEECH_METADATA_INDUSTRY_NAICS_CODE: rOpts.naicsCode}),
|
||||||
GOOGLE_SPEECH_METADATA_RECORDING_DEVICE_TYPE: 'phone_line',
|
GOOGLE_SPEECH_METADATA_RECORDING_DEVICE_TYPE: 'phone_line',
|
||||||
/*
|
|
||||||
...(useV2 && {
|
...(useV2 && {
|
||||||
GOOGLE_SPEECH_RECOGNIZER_PARENT: `projects/${sttCredentials.credentials.project_id}/locations/global`,
|
GOOGLE_SPEECH_RECOGNIZER_PARENT: `projects/${sttCredentials.credentials.project_id}/locations/global`,
|
||||||
GOOGLE_SPEECH_CLOUD_SERVICES_VERSION: 'v2'
|
GOOGLE_SPEECH_CLOUD_SERVICES_VERSION: 'v2',
|
||||||
}),
|
...(rOpts.googleOptions?.speechStartTimeoutMs && {
|
||||||
*/
|
GOOGLE_SPEECH_START_TIMEOUT_MS: rOpts.googleOptions.speechStartTimeoutMs
|
||||||
|
}),
|
||||||
|
...(rOpts.googleOptions?.speechEndTimeoutMs && {
|
||||||
|
GOOGLE_SPEECH_END_TIMEOUT_MS: rOpts.googleOptions.speechEndTimeoutMs
|
||||||
|
}),
|
||||||
|
...(rOpts.googleOptions?.transcriptNormalization && {
|
||||||
|
GOOGLE_SPEECH_TRANSCRIPTION_NORMALIZATION: JSON.stringify(rOpts.googleOptions.transcriptNormalization)
|
||||||
|
})
|
||||||
|
}),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
else if (['aws', 'polly'].includes(vendor)) {
|
else if (['aws', 'polly'].includes(vendor)) {
|
||||||
|
|||||||
14
package-lock.json
generated
14
package-lock.json
generated
@@ -18,7 +18,7 @@
|
|||||||
"@jambonz/speech-utils": "^0.0.44",
|
"@jambonz/speech-utils": "^0.0.44",
|
||||||
"@jambonz/stats-collector": "^0.1.9",
|
"@jambonz/stats-collector": "^0.1.9",
|
||||||
"@jambonz/time-series": "^0.2.8",
|
"@jambonz/time-series": "^0.2.8",
|
||||||
"@jambonz/verb-specifications": "^0.0.64",
|
"@jambonz/verb-specifications": "^0.0.66",
|
||||||
"@opentelemetry/api": "^1.4.0",
|
"@opentelemetry/api": "^1.4.0",
|
||||||
"@opentelemetry/exporter-jaeger": "^1.9.0",
|
"@opentelemetry/exporter-jaeger": "^1.9.0",
|
||||||
"@opentelemetry/exporter-trace-otlp-http": "^0.35.0",
|
"@opentelemetry/exporter-trace-otlp-http": "^0.35.0",
|
||||||
@@ -3514,9 +3514,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@jambonz/verb-specifications": {
|
"node_modules/@jambonz/verb-specifications": {
|
||||||
"version": "0.0.64",
|
"version": "0.0.66",
|
||||||
"resolved": "https://registry.npmjs.org/@jambonz/verb-specifications/-/verb-specifications-0.0.64.tgz",
|
"resolved": "https://registry.npmjs.org/@jambonz/verb-specifications/-/verb-specifications-0.0.66.tgz",
|
||||||
"integrity": "sha512-cW9wci240vSkVqVhN/B0MnJYXL4vUCAOia0ccNlVDiQmrcED3hFU1IkFXHRzyY5uiD+GaoapXUOqaerjbDtmLA==",
|
"integrity": "sha512-K1+7PCoKAEw/sOhqRFD6FjZHt/G9I0kaM24Zrh//W1zblc9jXvg8YIn1Hwx94yXemWMkqNNrmJsnyL9haOi5rg==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"debug": "^4.3.4",
|
"debug": "^4.3.4",
|
||||||
"pino": "^8.8.0"
|
"pino": "^8.8.0"
|
||||||
@@ -14183,9 +14183,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@jambonz/verb-specifications": {
|
"@jambonz/verb-specifications": {
|
||||||
"version": "0.0.64",
|
"version": "0.0.66",
|
||||||
"resolved": "https://registry.npmjs.org/@jambonz/verb-specifications/-/verb-specifications-0.0.64.tgz",
|
"resolved": "https://registry.npmjs.org/@jambonz/verb-specifications/-/verb-specifications-0.0.66.tgz",
|
||||||
"integrity": "sha512-cW9wci240vSkVqVhN/B0MnJYXL4vUCAOia0ccNlVDiQmrcED3hFU1IkFXHRzyY5uiD+GaoapXUOqaerjbDtmLA==",
|
"integrity": "sha512-K1+7PCoKAEw/sOhqRFD6FjZHt/G9I0kaM24Zrh//W1zblc9jXvg8YIn1Hwx94yXemWMkqNNrmJsnyL9haOi5rg==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"debug": "^4.3.4",
|
"debug": "^4.3.4",
|
||||||
"pino": "^8.8.0"
|
"pino": "^8.8.0"
|
||||||
|
|||||||
@@ -34,7 +34,7 @@
|
|||||||
"@jambonz/speech-utils": "^0.0.44",
|
"@jambonz/speech-utils": "^0.0.44",
|
||||||
"@jambonz/stats-collector": "^0.1.9",
|
"@jambonz/stats-collector": "^0.1.9",
|
||||||
"@jambonz/time-series": "^0.2.8",
|
"@jambonz/time-series": "^0.2.8",
|
||||||
"@jambonz/verb-specifications": "^0.0.64",
|
"@jambonz/verb-specifications": "^0.0.66",
|
||||||
"@opentelemetry/api": "^1.4.0",
|
"@opentelemetry/api": "^1.4.0",
|
||||||
"@opentelemetry/exporter-jaeger": "^1.9.0",
|
"@opentelemetry/exporter-jaeger": "^1.9.0",
|
||||||
"@opentelemetry/exporter-trace-otlp-http": "^0.35.0",
|
"@opentelemetry/exporter-trace-otlp-http": "^0.35.0",
|
||||||
|
|||||||
Reference in New Issue
Block a user