Merge pull request #1557 from xinnan-tech/py_fix_logger

fix:  logger中vad和asr动态变化
This commit is contained in:
CGD
2025-06-12 10:16:06 +08:00
committed by GitHub
2 changed files with 9 additions and 0 deletions
+1
View File
@@ -114,6 +114,7 @@ def update_module_string(selected_module_str):
current_module = logger._core.extra["selected_module"]
if current_module == selected_module_str:
logger.debug(f"组件未更改无需更新")
return
try:
+8
View File
@@ -424,6 +424,14 @@ class ConnectionHandler:
init_vad = check_vad_update(self.common_config, private_config)
init_asr = check_asr_update(self.common_config, private_config)
if init_vad:
self.config["selected_module"]["VAD"] = private_config["selected_module"][
"VAD"
]
if init_asr:
self.config["selected_module"]["ASR"] = private_config["selected_module"][
"ASR"
]
if private_config.get("TTS", None) is not None:
init_tts = True
self.config["TTS"] = private_config["TTS"]