From 53ad9708bd43cbf18e8496aefbafa9f435341ea1 Mon Sep 17 00:00:00 2001 From: taylor Date: Mon, 14 Oct 2024 22:12:32 +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 --- maubot_llmplus/aibot.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/maubot_llmplus/aibot.py b/maubot_llmplus/aibot.py index 18ce8e9..32ff00c 100644 --- a/maubot_llmplus/aibot.py +++ b/maubot_llmplus/aibot.py @@ -206,9 +206,14 @@ class AiBotPlugin(AbsExtraConfigPlugin): @command.argument("argus") async def switch(self, event: MessageEvent, argus: str): # 判断是否是本地ai模型,如果是还需要解析#后的type + if argus == 'local_ai': + await event.reply("local ai platform has ollama and lmstudio. " + "you can type `!ai use local_ai#{type}`. " + "Example: local_ai#ollama") + pass if argus == 'local_ai#ollama' or argus == 'local_ai#lmstudio': if argus.split('#')[1] == self.config.cur_platform: - event.reply(f"current ai platform has be {argus}") + await event.reply(f"current ai platform has be {argus}") pass else: self.config.cur_platform = argus @@ -217,7 +222,7 @@ class AiBotPlugin(AbsExtraConfigPlugin): # 如果是openai或者是claude elif argus == 'openai' or argus == 'anthropic': if argus == self.config.cur_platform: - event.reply(f"current ai platform has be {argus}") + await event.reply(f"current ai platform has be {argus}") pass else: self.config.cur_platform = argus @@ -225,10 +230,10 @@ class AiBotPlugin(AbsExtraConfigPlugin): self.config.cur_model = self.config['platforms'][argus]['model'] await event.react("✅") else: - event.reply(f"nof found ai platform: {argus}") + await event.reply(f"nof found ai platform: {argus}") pass self.log.debug(f"switch platform: {self.config.cur_platform}") - self.log.debug(f"use default cofig model: {self.config.cur_model}") + self.log.debug(f"use default config model: {self.config.cur_model}") @classmethod def get_config_class(cls) -> Type[BaseProxyConfig]: