support deeepgram influx (#501)

* support deeepgram influx

* update verb specification
This commit is contained in:
Hoan Luu Huu
2025-10-03 21:09:19 +07:00
committed by GitHub
parent 9421bb8aa1
commit c3d12fafee
5 changed files with 15 additions and 15 deletions

View File

@@ -238,10 +238,10 @@ const encryptCredential = (obj) => {
});
return encrypt(resembleData);
case 'deepgramriver':
assert(api_key, 'invalid deepgram river speech credential: api_key is required');
const deepgramriverData = JSON.stringify({api_key});
return encrypt(deepgramriverData);
case 'deepgramflux':
assert(api_key, 'invalid deepgram flux speech credential: api_key is required');
const deepgramfluxData = JSON.stringify({api_key});
return encrypt(deepgramfluxData);
case 'ibm':
const ibmData = JSON.stringify({tts_api_key, tts_region, stt_api_key, stt_region, instance_id});
@@ -806,7 +806,7 @@ router.get('/:sid/test', async(req, res) => {
}
}
}
else if (cred.vendor === 'deepgramriver') {
else if (cred.vendor === 'deepgramflux') {
const {api_key} = credential;
if (cred.use_for_stt && api_key) {
try {

View File

@@ -686,7 +686,7 @@ function decryptCredential(obj, credential, logger, isObscureKey = true) {
obj.deepgram_tts_uri = o.deepgram_tts_uri;
obj.model_id = o.model_id;
}
else if ('deepgramriver' === obj.vendor) {
else if ('deepgramflux' === obj.vendor) {
const o = JSON.parse(decrypt(credential));
obj.api_key = isObscureKey ? obscureKey(o.api_key) : o.api_key;
}

8
package-lock.json generated
View File

@@ -22,7 +22,7 @@
"@jambonz/realtimedb-helpers": "^0.8.15",
"@jambonz/speech-utils": "^0.2.23",
"@jambonz/time-series": "^0.2.8",
"@jambonz/verb-specifications": "^0.0.111",
"@jambonz/verb-specifications": "^0.0.115",
"@soniox/soniox-node": "^1.2.2",
"ajv": "^8.17.1",
"argon2": "^0.40.1",
@@ -4254,9 +4254,9 @@
}
},
"node_modules/@jambonz/verb-specifications": {
"version": "0.0.111",
"resolved": "https://registry.npmjs.org/@jambonz/verb-specifications/-/verb-specifications-0.0.111.tgz",
"integrity": "sha512-P2lDki5wCHGPPXpPTeMdht4NfGujF6NrLyrI8o/4U6l+2elfc/1mKl/Lz/PWGo9rQM4mTOVIhkk9ECo0NvOVoA==",
"version": "0.0.115",
"resolved": "https://registry.npmjs.org/@jambonz/verb-specifications/-/verb-specifications-0.0.115.tgz",
"integrity": "sha512-T2J5skCZBADaxePkFqpm0JYwr5Iu6e9zgvk6j0/4vD6lwK29GSoSdk2LCKUY6VH2GYdaN6r3dyIw4xpFVXuMfQ==",
"license": "MIT",
"dependencies": {
"debug": "^4.3.4",

View File

@@ -33,7 +33,7 @@
"@jambonz/realtimedb-helpers": "^0.8.15",
"@jambonz/speech-utils": "^0.2.23",
"@jambonz/time-series": "^0.2.8",
"@jambonz/verb-specifications": "^0.0.111",
"@jambonz/verb-specifications": "^0.0.115",
"@soniox/soniox-node": "^1.2.2",
"ajv": "^8.17.1",
"argon2": "^0.40.1",

View File

@@ -930,21 +930,21 @@ test('speech credentials tests', async(t) => {
auth: authUser,
json: true,
body: {
vendor: 'deepgramriver',
vendor: 'deepgramflux',
use_for_tts: false,
use_for_stt: true,
api_key: 'api_key',
}
});
t.ok(result.statusCode === 201, 'successfully added speech credential for Verbio');
const deepgramriverSid = result.body.sid;
const deepgramfluxSid = result.body.sid;
/* delete the credential */
result = await request.delete(`/Accounts/${account_sid}/SpeechCredentials/${deepgramriverSid}`, {
result = await request.delete(`/Accounts/${account_sid}/SpeechCredentials/${deepgramfluxSid}`, {
auth: authUser,
resolveWithFullResponse: true,
});
t.ok(result.statusCode === 204, 'successfully deleted speech credential deepgramriver');
t.ok(result.statusCode === 204, 'successfully deleted speech credential deepgramflux');
/* Check google supportedLanguagesAndVoices */
result = await request.get(`/Accounts/${account_sid}/SpeechCredentials/speech/supportedLanguagesAndVoices?vendor=google`, {