Add Volcengine support for TTS and ASR services
- Introduced Volcengine as a new provider for both TTS and ASR services. - Updated configuration files to include Volcengine-specific parameters such as app_id, resource_id, and uid. - Enhanced the ASR service to support streaming mode with Volcengine's API. - Modified existing tests to validate the integration of Volcengine services. - Updated documentation to reflect the addition of Volcengine as a supported provider for TTS and ASR. - Refactored service factory to accommodate Volcengine alongside existing providers.
This commit is contained in:
@@ -230,6 +230,14 @@ class LocalYamlAssistantConfigAdapter(NullBackendAdapter):
|
||||
tts_runtime["baseUrl"] = cls._as_str(tts.get("api_url"))
|
||||
if cls._as_str(tts.get("voice")):
|
||||
tts_runtime["voice"] = cls._as_str(tts.get("voice"))
|
||||
if cls._as_str(tts.get("app_id")):
|
||||
tts_runtime["appId"] = cls._as_str(tts.get("app_id"))
|
||||
if cls._as_str(tts.get("resource_id")):
|
||||
tts_runtime["resourceId"] = cls._as_str(tts.get("resource_id"))
|
||||
if cls._as_str(tts.get("cluster")):
|
||||
tts_runtime["cluster"] = cls._as_str(tts.get("cluster"))
|
||||
if cls._as_str(tts.get("uid")):
|
||||
tts_runtime["uid"] = cls._as_str(tts.get("uid"))
|
||||
if tts.get("speed") is not None:
|
||||
tts_runtime["speed"] = tts.get("speed")
|
||||
dashscope_mode = cls._as_str(tts.get("dashscope_mode")) or cls._as_str(tts.get("mode"))
|
||||
@@ -249,6 +257,16 @@ class LocalYamlAssistantConfigAdapter(NullBackendAdapter):
|
||||
asr_runtime["apiKey"] = cls._as_str(asr.get("api_key"))
|
||||
if cls._as_str(asr.get("api_url")):
|
||||
asr_runtime["baseUrl"] = cls._as_str(asr.get("api_url"))
|
||||
if cls._as_str(asr.get("app_id")):
|
||||
asr_runtime["appId"] = cls._as_str(asr.get("app_id"))
|
||||
if cls._as_str(asr.get("resource_id")):
|
||||
asr_runtime["resourceId"] = cls._as_str(asr.get("resource_id"))
|
||||
if cls._as_str(asr.get("cluster")):
|
||||
asr_runtime["cluster"] = cls._as_str(asr.get("cluster"))
|
||||
if cls._as_str(asr.get("uid")):
|
||||
asr_runtime["uid"] = cls._as_str(asr.get("uid"))
|
||||
if isinstance(asr.get("request_params"), dict):
|
||||
asr_runtime["requestParams"] = dict(asr.get("request_params") or {})
|
||||
if asr.get("enable_interim") is not None:
|
||||
asr_runtime["enableInterim"] = asr.get("enable_interim")
|
||||
if asr.get("interim_interval_ms") is not None:
|
||||
|
||||
Reference in New Issue
Block a user