mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-11-23 03:19:41 +00:00
fix: 配置读取缺失
This commit is contained in:
parent
9100e7ecd2
commit
4ae96c6e02
1 changed files with 3 additions and 1 deletions
|
|
@ -916,6 +916,8 @@ class ConnectionHandler:
|
||||||
self.chat_history_conf = int(private_config["chat_history_conf"])
|
self.chat_history_conf = int(private_config["chat_history_conf"])
|
||||||
if private_config.get("mcp_endpoint", None) is not None:
|
if private_config.get("mcp_endpoint", None) is not None:
|
||||||
self.config["mcp_endpoint"] = private_config["mcp_endpoint"]
|
self.config["mcp_endpoint"] = private_config["mcp_endpoint"]
|
||||||
|
if private_config.get("mcp_forward_speaker", None) is not None:
|
||||||
|
self.config["mcp_forward_speaker"] = private_config["mcp_forward_speaker"]
|
||||||
if private_config.get("context_providers", None) is not None:
|
if private_config.get("context_providers", None) is not None:
|
||||||
self.config["context_providers"] = private_config["context_providers"]
|
self.config["context_providers"] = private_config["context_providers"]
|
||||||
|
|
||||||
|
|
@ -1132,7 +1134,7 @@ class ConnectionHandler:
|
||||||
try:
|
try:
|
||||||
parsed = json.loads(q)
|
parsed = json.loads(q)
|
||||||
if isinstance(parsed, dict):
|
if isinstance(parsed, dict):
|
||||||
cs = (parsed.get("speaker") or "").strip()
|
cs = str(parsed.get("speaker") or "").strip()
|
||||||
except (json.JSONDecodeError, TypeError, ValueError):
|
except (json.JSONDecodeError, TypeError, ValueError):
|
||||||
pass
|
pass
|
||||||
if cs and cs != UNKNOWN_SPEAKER_NAME and cs not in self.system_introduced_speakers:
|
if cs and cs != UNKNOWN_SPEAKER_NAME and cs not in self.system_introduced_speakers:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue