From e9dc178e837fcbdbc218a701c8b8b94943024753 Mon Sep 17 00:00:00 2001 From: taylor <=> Date: Mon, 14 Oct 2024 14:08:22 +0800 Subject: [PATCH] =?UTF-8?q?add:=20=E5=A2=9E=E5=8A=A0=E5=88=87=E6=8D=A2ai?= =?UTF-8?q?=E5=B9=B3=E5=8F=B0=E5=91=BD=E4=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- maubot_llmplus/aibot.py | 7 ++++++- maubot_llmplus/platforms.py | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/maubot_llmplus/aibot.py b/maubot_llmplus/aibot.py index 64bccc7..790842f 100644 --- a/maubot_llmplus/aibot.py +++ b/maubot_llmplus/aibot.py @@ -150,6 +150,11 @@ class AiBotPlugin(AbsExtraConfigPlugin): platform = self.get_ai_platform() models = await platform.list_models() await event.reply("\n".join(models), markdown=True) + pass + # 如果是current,显示出当前的使用模型 + if argus == 'current': + await event.reply(f"current use model is {self.config.cur_model}") + pass @ai_command.subcommand(help="") @command.argument("argus") @@ -159,7 +164,7 @@ class AiBotPlugin(AbsExtraConfigPlugin): models = await platform.list_models() if f"- {argus}" in models: self.log.debug(f"switch model: {argus}") - self.config._cur_model = argus + self.config.cur_model = argus await event.react("✅") else: await event.reply("not found valid model") diff --git a/maubot_llmplus/platforms.py b/maubot_llmplus/platforms.py index cbb5577..c0332cb 100644 --- a/maubot_llmplus/platforms.py +++ b/maubot_llmplus/platforms.py @@ -39,6 +39,7 @@ class Platform: self.http = http self.config = config['platforms'][self.get_type()] self.url = self.config['url'] + # 设置当前的使用模型,这里不直接使用config对象下的配置值,而是加入了与命令决定后的使用模型名称 self.model = config.cur_model self.max_words = self.config['max_words'] self.api_key = self.config['api_key']