mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-20 16:50:39 +00:00
fixes for runtime speech credentials
This commit is contained in:
@@ -385,15 +385,15 @@ module.exports = (logger) => {
|
|||||||
const setSpeechCredentialsAtRuntime = (recognizer) => {
|
const setSpeechCredentialsAtRuntime = (recognizer) => {
|
||||||
if (!recognizer) return;
|
if (!recognizer) return;
|
||||||
if (recognizer.vendor === 'nuance') {
|
if (recognizer.vendor === 'nuance') {
|
||||||
const {clientId, secret} = recognizer.nuanceOptions;
|
const {clientId, secret} = recognizer.nuanceOptions || {};
|
||||||
if (clientId && secret) return {client_id: clientId, secret};
|
if (clientId && secret) return {client_id: clientId, secret};
|
||||||
}
|
}
|
||||||
else if (recognizer.vendor === 'deepgram') {
|
else if (recognizer.vendor === 'deepgram') {
|
||||||
const {apiKey} = recognizer.deepgramOptions;
|
const {apiKey} = recognizer.deepgramOptions || {};
|
||||||
if (apiKey) return {api_key: apiKey};
|
if (apiKey) return {api_key: apiKey};
|
||||||
}
|
}
|
||||||
else if (recognizer.vendor === 'ibm') {
|
else if (recognizer.vendor === 'ibm') {
|
||||||
const {ttsApiKey, ttsRegion, sttApiKey, sttRegion, instanceId} = recognizer.ibmOptions;
|
const {ttsApiKey, ttsRegion, sttApiKey, sttRegion, instanceId} = recognizer.ibmOptions || {};
|
||||||
if (ttsApiKey || sttApiKey) return {
|
if (ttsApiKey || sttApiKey) return {
|
||||||
tts_api_key: ttsApiKey,
|
tts_api_key: ttsApiKey,
|
||||||
tts_region: ttsRegion,
|
tts_region: ttsRegion,
|
||||||
|
|||||||
Reference in New Issue
Block a user