mirror of
https://github.com/jambonz/jambonz-api-server.git
synced 2026-10-04 02:04:18 +00:00
support deepgram river (#481)
* support deepgram river * update verb specification version
This commit is contained in:
@@ -226,6 +226,11 @@ const encryptCredential = (obj) => {
|
|||||||
deepgram_stt_use_tls, deepgram_tts_uri, model_id});
|
deepgram_stt_use_tls, deepgram_tts_uri, model_id});
|
||||||
return encrypt(deepgramData);
|
return encrypt(deepgramData);
|
||||||
|
|
||||||
|
case 'deepgramriver':
|
||||||
|
assert(api_key, 'invalid deepgram river speech credential: api_key is required');
|
||||||
|
const deepgramriverData = JSON.stringify({api_key});
|
||||||
|
return encrypt(deepgramriverData);
|
||||||
|
|
||||||
case 'ibm':
|
case 'ibm':
|
||||||
const ibmData = JSON.stringify({tts_api_key, tts_region, stt_api_key, stt_region, instance_id});
|
const ibmData = JSON.stringify({tts_api_key, tts_region, stt_api_key, stt_region, instance_id});
|
||||||
return encrypt(ibmData);
|
return encrypt(ibmData);
|
||||||
@@ -774,6 +779,19 @@ router.get('/:sid/test', async(req, res) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (cred.vendor === 'deepgramriver') {
|
||||||
|
const {api_key} = credential;
|
||||||
|
if (cred.use_for_stt && api_key) {
|
||||||
|
try {
|
||||||
|
await testDeepgramStt(logger, {api_key});
|
||||||
|
results.stt.status = 'ok';
|
||||||
|
SpeechCredential.sttTestResult(sid, true);
|
||||||
|
} catch (err) {
|
||||||
|
results.stt = {status: 'fail', reason: err.message};
|
||||||
|
SpeechCredential.sttTestResult(sid, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
else if (cred.vendor === 'ibm') {
|
else if (cred.vendor === 'ibm') {
|
||||||
const {getTtsVoices} = req.app.locals;
|
const {getTtsVoices} = req.app.locals;
|
||||||
|
|
||||||
|
|||||||
Generated
+4
-4
@@ -22,7 +22,7 @@
|
|||||||
"@jambonz/realtimedb-helpers": "^0.8.15",
|
"@jambonz/realtimedb-helpers": "^0.8.15",
|
||||||
"@jambonz/speech-utils": "^0.2.13",
|
"@jambonz/speech-utils": "^0.2.13",
|
||||||
"@jambonz/time-series": "^0.2.8",
|
"@jambonz/time-series": "^0.2.8",
|
||||||
"@jambonz/verb-specifications": "^0.0.107",
|
"@jambonz/verb-specifications": "^0.0.111",
|
||||||
"@soniox/soniox-node": "^1.2.2",
|
"@soniox/soniox-node": "^1.2.2",
|
||||||
"ajv": "^8.17.1",
|
"ajv": "^8.17.1",
|
||||||
"argon2": "^0.40.1",
|
"argon2": "^0.40.1",
|
||||||
@@ -4201,9 +4201,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@jambonz/verb-specifications": {
|
"node_modules/@jambonz/verb-specifications": {
|
||||||
"version": "0.0.107",
|
"version": "0.0.111",
|
||||||
"resolved": "https://registry.npmjs.org/@jambonz/verb-specifications/-/verb-specifications-0.0.107.tgz",
|
"resolved": "https://registry.npmjs.org/@jambonz/verb-specifications/-/verb-specifications-0.0.111.tgz",
|
||||||
"integrity": "sha512-pkH02jUBNG9GluJdrbyO6tboN1/XANXmIoLtmKlX96VtKUGDr+li+lTGEpkMkIM+O1NjT/PSEXzGVPQwxLaKug==",
|
"integrity": "sha512-P2lDki5wCHGPPXpPTeMdht4NfGujF6NrLyrI8o/4U6l+2elfc/1mKl/Lz/PWGo9rQM4mTOVIhkk9ECo0NvOVoA==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"debug": "^4.3.4",
|
"debug": "^4.3.4",
|
||||||
|
|||||||
+1
-1
@@ -33,7 +33,7 @@
|
|||||||
"@jambonz/realtimedb-helpers": "^0.8.15",
|
"@jambonz/realtimedb-helpers": "^0.8.15",
|
||||||
"@jambonz/speech-utils": "^0.2.13",
|
"@jambonz/speech-utils": "^0.2.13",
|
||||||
"@jambonz/time-series": "^0.2.8",
|
"@jambonz/time-series": "^0.2.8",
|
||||||
"@jambonz/verb-specifications": "^0.0.107",
|
"@jambonz/verb-specifications": "^0.0.111",
|
||||||
"@soniox/soniox-node": "^1.2.2",
|
"@soniox/soniox-node": "^1.2.2",
|
||||||
"ajv": "^8.17.1",
|
"ajv": "^8.17.1",
|
||||||
"argon2": "^0.40.1",
|
"argon2": "^0.40.1",
|
||||||
|
|||||||
@@ -902,6 +902,28 @@ test('speech credentials tests', async(t) => {
|
|||||||
});
|
});
|
||||||
t.ok(result.statusCode === 204, 'successfully deleted speech credential');
|
t.ok(result.statusCode === 204, 'successfully deleted speech credential');
|
||||||
|
|
||||||
|
/* add a credential for deepgram river */
|
||||||
|
result = await request.post(`/Accounts/${account_sid}/SpeechCredentials`, {
|
||||||
|
resolveWithFullResponse: true,
|
||||||
|
auth: authUser,
|
||||||
|
json: true,
|
||||||
|
body: {
|
||||||
|
vendor: 'deepgramriver',
|
||||||
|
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;
|
||||||
|
|
||||||
|
/* delete the credential */
|
||||||
|
result = await request.delete(`/Accounts/${account_sid}/SpeechCredentials/${deepgramriverSid}`, {
|
||||||
|
auth: authUser,
|
||||||
|
resolveWithFullResponse: true,
|
||||||
|
});
|
||||||
|
t.ok(result.statusCode === 204, 'successfully deleted speech credential deepgramriver');
|
||||||
|
|
||||||
/* Check google supportedLanguagesAndVoices */
|
/* Check google supportedLanguagesAndVoices */
|
||||||
result = await request.get(`/Accounts/${account_sid}/SpeechCredentials/speech/supportedLanguagesAndVoices?vendor=google`, {
|
result = await request.get(`/Accounts/${account_sid}/SpeechCredentials/speech/supportedLanguagesAndVoices?vendor=google`, {
|
||||||
resolveWithFullResponse: true,
|
resolveWithFullResponse: true,
|
||||||
|
|||||||
Reference in New Issue
Block a user