support assemblyai v3 (#475)

* support assemblyai v3

* update verb specification
This commit is contained in:
Hoan Luu Huu
2025-07-02 02:48:00 +07:00
committed by GitHub
parent 9b4f1b67bf
commit 0ba69e872b
5 changed files with 12 additions and 7 deletions

View File

@@ -158,6 +158,7 @@ const encryptCredential = (obj) => {
user_id,
voice_engine,
engine_version,
service_version,
options
} = obj;
@@ -292,7 +293,7 @@ const encryptCredential = (obj) => {
case 'assemblyai':
assert(api_key, 'invalid assemblyai speech credential: api_key is required');
const assemblyaiData = JSON.stringify({api_key});
const assemblyaiData = JSON.stringify({api_key, service_version});
return encrypt(assemblyaiData);
case 'voxist':
@@ -516,6 +517,7 @@ router.put('/:sid', async(req, res) => {
deepgram_tts_uri,
playht_tts_uri,
engine_version,
service_version,
speechmatics_stt_uri
} = req.body;
@@ -548,6 +550,7 @@ router.put('/:sid', async(req, res) => {
deepgram_tts_uri,
playht_tts_uri,
engine_version,
service_version,
speechmatics_stt_uri
};
logger.info({o, newCred}, 'updating speech credential with this new credential');

View File

@@ -726,6 +726,7 @@ function decryptCredential(obj, credential, logger, isObscureKey = true) {
} else if ('assemblyai' === obj.vendor) {
const o = JSON.parse(decrypt(credential));
obj.api_key = isObscureKey ? obscureKey(o.api_key) : o.api_key;
obj.service_version = o.service_version;
} else if ('voxist' === 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.14",
"@jambonz/speech-utils": "^0.2.13",
"@jambonz/time-series": "^0.2.8",
"@jambonz/verb-specifications": "^0.0.104",
"@jambonz/verb-specifications": "^0.0.106",
"@soniox/soniox-node": "^1.2.2",
"ajv": "^8.17.1",
"argon2": "^0.40.1",
@@ -4270,9 +4270,9 @@
}
},
"node_modules/@jambonz/verb-specifications": {
"version": "0.0.104",
"resolved": "https://registry.npmjs.org/@jambonz/verb-specifications/-/verb-specifications-0.0.104.tgz",
"integrity": "sha512-G1LjK6ISujdg0zALudtUvdaPXmvA4FU6x3s8S9MwUbWbFo2WERMUcNOgQAutDZwOMrLH9DnbPL8ZIdnTCKnlkA==",
"version": "0.0.106",
"resolved": "https://registry.npmjs.org/@jambonz/verb-specifications/-/verb-specifications-0.0.106.tgz",
"integrity": "sha512-xBCGKKW5QC7ItZyeF22esytpG2yIhkGWIvBgTaf97CilQmUdLGo3rWG3i7qnRvU9MPXFCtVCMt/aaMt1Ep6V2g==",
"license": "MIT",
"dependencies": {
"debug": "^4.3.4",

View File

@@ -33,7 +33,7 @@
"@jambonz/realtimedb-helpers": "^0.8.14",
"@jambonz/speech-utils": "^0.2.13",
"@jambonz/time-series": "^0.2.8",
"@jambonz/verb-specifications": "^0.0.104",
"@jambonz/verb-specifications": "^0.0.106",
"@soniox/soniox-node": "^1.2.2",
"ajv": "^8.17.1",
"argon2": "^0.40.1",

View File

@@ -791,7 +791,8 @@ test('speech credentials tests', async(t) => {
body: {
vendor: 'assemblyai',
use_for_stt: true,
api_key: "APIKEY"
api_key: "APIKEY",
service_version: 'v2'
}
});
t.ok(result.statusCode === 201, 'successfully added speech credential for assemblyai');