From aaefdab0aa4b07e5043a2b2b400d6926635267fd Mon Sep 17 00:00:00 2001 From: Soulter <905617992@qq.com> Date: Mon, 20 Nov 2023 14:56:28 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E8=AF=AD=E8=A8=80=E6=A8=A1=E5=9E=8B=E5=90=AF=E5=8A=A8=E6=97=B6?= =?UTF-8?q?=E8=BE=93=E5=85=A5=E6=8C=87=E4=BB=A4=E6=8A=A5=E9=94=99=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cores/qqbot/core.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cores/qqbot/core.py b/cores/qqbot/core.py index 0d60f4988..262483622 100644 --- a/cores/qqbot/core.py +++ b/cores/qqbot/core.py @@ -68,6 +68,7 @@ REV_CHATGPT = 'rev_chatgpt' OPENAI_OFFICIAL = 'openai_official' REV_ERNIE = 'rev_ernie' REV_EDGEGPT = 'rev_edgegpt' +NONE_LLM = 'none_llm' chosen_provider = None # 语言模型对象 @@ -315,12 +316,16 @@ def initBot(cfg, prov): gu.log("--------加载插件--------", gu.LEVEL_INFO, fg=gu.FG_COLORS['yellow']) # 加载插件 - _command = Command(None, None) + _command = Command(None, _global_object) ok, err = _command.plugin_reload(_global_object.cached_plugins) if ok: gu.log("加载插件完成", gu.LEVEL_INFO) else: gu.log(err, gu.LEVEL_ERROR) + + if chosen_provider is None: + llm_command_instance[NONE_LLM] = _command + chosen_provider = NONE_LLM gu.log("--------加载机器人平台--------", gu.LEVEL_INFO, fg=gu.FG_COLORS['yellow'])