mirror of
https://github.com/zhayujie/chatgpt-on-wechat.git
synced 2026-07-20 13:47:15 +08:00
fix: web console bot_type
This commit is contained in:
@@ -523,6 +523,7 @@ class ConfigHandler:
|
||||
"title": title,
|
||||
"model": local_config.get("model", ""),
|
||||
"bot_type": local_config.get("bot_type", ""),
|
||||
"has_bot_type": "bot_type" in local_config,
|
||||
"use_linkai": bool(local_config.get("use_linkai", False)),
|
||||
"channel_type": local_config.get("channel_type", ""),
|
||||
"agent_max_context_tokens": local_config.get("agent_max_context_tokens", 50000),
|
||||
@@ -567,6 +568,9 @@ class ConfigHandler:
|
||||
file_cfg = json.load(f)
|
||||
else:
|
||||
file_cfg = {}
|
||||
if "bot_type" in applied and "bot_type" not in file_cfg:
|
||||
del applied["bot_type"]
|
||||
local_config.pop("bot_type", None)
|
||||
file_cfg.update(applied)
|
||||
with open(config_path, "w", encoding="utf-8") as f:
|
||||
json.dump(file_cfg, f, indent=4, ensure_ascii=False)
|
||||
|
||||
Reference in New Issue
Block a user