fixed undefine issue when setting tts streaming channel vars (#1456)

This commit is contained in:
Hoan Luu Huu
2025-12-03 07:46:28 +07:00
committed by GitHub
parent 8048e9cf88
commit edb4d21ce1

View File

@@ -89,8 +89,9 @@ class TtsTask extends Task {
// api_key, model_id, api_uri, custom_tts_streaming_url, and auth_token are encoded in the credentials
// allow them to be overriden via config, using options
// give preference to options passed in via config
const local_options = {...JSON.parse(options), ...this.options};
const local_voice_settings = {...JSON.parse(options).voice_settings, ...this.options.voice_settings};
const parsed_options = options ? JSON.parse(options) : {};
const local_options = {...parsed_options, ...this.options};
const local_voice_settings = {...(parsed_options.voice_settings || {}), ...(this.options.voice_settings || {})};
const local_api_key = local_options.api_key ?? api_key;
const local_model_id = local_options.model_id ?? model_id;
const local_api_uri = local_options.api_uri ?? api_uri;