support whisper streaming

This commit is contained in:
Quan HL
2024-02-19 15:42:04 +07:00
parent 32b317ae68
commit 7d56076c96
2 changed files with 2 additions and 1 deletions

View File

@@ -228,7 +228,7 @@ const encryptCredential = (obj) => {
case 'whisper': case 'whisper':
assert(api_key, 'invalid whisper speech credential: api_key is required'); assert(api_key, 'invalid whisper speech credential: api_key is required');
assert(model_id, 'invalid whisper speech credential: model_id is required'); assert(model_id, 'invalid whisper speech credential: model_id is required');
const whisperData = JSON.stringify({api_key, model_id}); const whisperData = JSON.stringify({api_key, model_id, use_streaming});
return encrypt(whisperData); return encrypt(whisperData);
default: default:

View File

@@ -443,6 +443,7 @@ function decryptCredential(obj, credential, logger, isObscureKey = true) {
const o = JSON.parse(decrypt(credential)); const o = JSON.parse(decrypt(credential));
obj.api_key = isObscureKey ? obscureKey(o.api_key) : o.api_key; obj.api_key = isObscureKey ? obscureKey(o.api_key) : o.api_key;
obj.model_id = o.model_id; obj.model_id = o.model_id;
obj.use_streaming = o.use_streaming;
} }
} }