From 8874bef006cdc6ba7f0ae81513675d6a6f1c1995 Mon Sep 17 00:00:00 2001 From: taylor Date: Mon, 14 Oct 2024 21:28:18 +0800 Subject: [PATCH] =?UTF-8?q?add:=20=E5=A2=9E=E5=8A=A0=E6=9F=A5=E7=9C=8B?= =?UTF-8?q?=E5=BD=93=E5=89=8D=E4=BD=BF=E7=94=A8=E7=9A=84ai=E5=B9=B3?= =?UTF-8?q?=E5=8F=B0=E5=91=BD=E4=BB=A4=20add:=20=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E6=9F=A5=E7=9C=8Binfo=E5=91=BD=E4=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .idea/maubot-llmplus.iml | 2 +- .idea/misc.xml | 2 +- maubot_llmplus/aibot.py | 30 +++++++++++++++++++++++++++++- 3 files changed, 31 insertions(+), 3 deletions(-) diff --git a/.idea/maubot-llmplus.iml b/.idea/maubot-llmplus.iml index 9d99f9e..6d99fbe 100644 --- a/.idea/maubot-llmplus.iml +++ b/.idea/maubot-llmplus.iml @@ -4,7 +4,7 @@ - + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index 74d11cf..90553d3 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,4 +1,4 @@ - + \ No newline at end of file diff --git a/maubot_llmplus/aibot.py b/maubot_llmplus/aibot.py index e8c1598..5e1689d 100644 --- a/maubot_llmplus/aibot.py +++ b/maubot_llmplus/aibot.py @@ -140,12 +140,40 @@ class AiBotPlugin(AbsExtraConfigPlugin): """ @ai_command.subcommand(help="") async def info(self, event: MessageEvent) -> None: + show_infos = [] + # 当前机器人名称 + show_infos.append(f"bot name: {self.get_bot_name()}\n") # 查询当前使用的ai平台 + show_infos.append(f"platform: {self.get_cur_platform()}\n") + show_infos.append("platform detail: \n") # 查询当前ai平台的配置信息 + p_m_dict = dict(self.config['platforms'][self.get_cur_platform()]) + for k, v in p_m_dict: + show_infos.append(f"- {k}: {v}\n") # 当前使用的model - # 列出model信息 + show_infos.append(f"model: {self.config.cur_model}\n") + # TODO 列出model信息 pass + """ + 获取实际平台名称 + """ + def get_cur_platform(self) -> str: + platform_model = self.config.cur_platform + return platform_model.split('#')[0] + + @ai_command.subcommand(help="") + @command.argument("argus") + async def platform(self, event: MessageEvent, argus: str): + if argus == 'list': + p_dict = dict(self.config['platforms']) + platforms = [f"- {platform}" for platform in set(p_dict.keys())] + await event.reply("\n".join(platforms)) + pass + if argus == 'current': + await event.reply(f"current use platform is {self.config.cur_platform}") + pass + @ai_command.subcommand(help="") @command.argument("argus") async def model(self, event: MessageEvent, argus: str):