support deepgram model_id in speechCredential (#1213)

This commit is contained in:
Hoan Luu Huu
2025-05-28 19:00:56 +07:00
committed by GitHub
parent 690a7fcd55
commit 3475f39b1d
3 changed files with 3 additions and 1 deletions

View File

@@ -1032,6 +1032,7 @@ class CallSession extends Emitter {
return {
speech_credential_sid: credential.speech_credential_sid,
api_key: credential.api_key,
model_id: credential.model_id,
deepgram_stt_uri: credential.deepgram_stt_uri,
deepgram_tts_uri: credential.deepgram_tts_uri,
deepgram_stt_use_tls: credential.deepgram_stt_use_tls

View File

@@ -76,6 +76,7 @@ const speechMapper = (cred) => {
else if ('deepgram' === obj.vendor) {
const o = JSON.parse(decrypt(credential));
obj.api_key = o.api_key;
obj.model_id = o.model_id;
obj.deepgram_stt_uri = o.deepgram_stt_uri;
obj.deepgram_tts_uri = o.deepgram_tts_uri;
obj.deepgram_stt_use_tls = o.deepgram_stt_use_tls;

View File

@@ -829,7 +829,7 @@ module.exports = (logger) => {
};
}
else if ('deepgram' === vendor) {
let model = rOpts.deepgramOptions?.model || rOpts.model;
let model = rOpts.deepgramOptions?.model || rOpts.model || sttCredentials.model_id;
const {deepgramOptions = {}} = rOpts;
const deepgramUri = deepgramOptions.deepgramSttUri || sttCredentials.deepgram_stt_uri;
const useTls = deepgramOptions.deepgramSttUseTls || sttCredentials.deepgram_stt_use_tls;