support houndify stt (#498)

* support houndify stt

* wip

* test houdify stt credential

* wip

* wip

* update verb specification
This commit is contained in:
Hoan Luu Huu
2025-10-14 11:52:49 +07:00
committed by GitHub
parent 8267ddaffd
commit bcff9b35a6
6 changed files with 474 additions and 42 deletions
+21 -1
View File
@@ -16,7 +16,8 @@ const {decryptCredential, testWhisper, testDeepgramTTS,
testVoxistStt,
testOpenAiStt,
testInworld,
testResembleTTS} = require('../../utils/speech-utils');
testResembleTTS,
testHoundifyStt} = require('../../utils/speech-utils');
const {DbErrorUnprocessableRequest, DbErrorForbidden, DbErrorBadRequest} = require('../../utils/errors');
const {
testGoogleTts,
@@ -124,6 +125,7 @@ const encryptCredential = (obj) => {
role_arn,
region,
client_id,
client_key,
client_secret,
secret,
nuance_tts_uri,
@@ -318,6 +320,13 @@ const encryptCredential = (obj) => {
const assemblyaiData = JSON.stringify({api_key, service_version});
return encrypt(assemblyaiData);
case 'houndify':
assert(client_id, 'invalid houndify speech credential: client_id is required');
assert(client_key, 'invalid houndify speech credential: client_key is required');
assert(user_id, 'invalid houndify speech credential: user_id is required');
const houndifyData = JSON.stringify({client_id, client_key, user_id});
return encrypt(houndifyData);
case 'voxist':
assert(api_key, 'invalid voxist speech credential: api_key is required');
const voxistData = JSON.stringify({api_key});
@@ -970,6 +979,17 @@ router.get('/:sid/test', async(req, res) => {
SpeechCredential.sttTestResult(sid, false);
}
}
} else if (cred.vendor === 'houndify') {
if (cred.use_for_stt) {
try {
await testHoundifyStt(logger, credential);
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 === 'voxist') {
const {api_key} = credential;
if (cred.use_for_stt) {