add: 增加查看当前使用的ai平台命令
add: 增加查看info命令
This commit is contained in:
@@ -206,9 +206,14 @@ class AiBotPlugin(AbsExtraConfigPlugin):
|
|||||||
@command.argument("argus")
|
@command.argument("argus")
|
||||||
async def switch(self, event: MessageEvent, argus: str):
|
async def switch(self, event: MessageEvent, argus: str):
|
||||||
# 判断是否是本地ai模型,如果是还需要解析#后的type
|
# 判断是否是本地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 == 'local_ai#ollama' or argus == 'local_ai#lmstudio':
|
||||||
if argus.split('#')[1] == self.config.cur_platform:
|
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
|
pass
|
||||||
else:
|
else:
|
||||||
self.config.cur_platform = argus
|
self.config.cur_platform = argus
|
||||||
@@ -217,7 +222,7 @@ class AiBotPlugin(AbsExtraConfigPlugin):
|
|||||||
# 如果是openai或者是claude
|
# 如果是openai或者是claude
|
||||||
elif argus == 'openai' or argus == 'anthropic':
|
elif argus == 'openai' or argus == 'anthropic':
|
||||||
if argus == self.config.cur_platform:
|
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
|
pass
|
||||||
else:
|
else:
|
||||||
self.config.cur_platform = argus
|
self.config.cur_platform = argus
|
||||||
@@ -225,10 +230,10 @@ class AiBotPlugin(AbsExtraConfigPlugin):
|
|||||||
self.config.cur_model = self.config['platforms'][argus]['model']
|
self.config.cur_model = self.config['platforms'][argus]['model']
|
||||||
await event.react("✅")
|
await event.react("✅")
|
||||||
else:
|
else:
|
||||||
event.reply(f"nof found ai platform: {argus}")
|
await event.reply(f"nof found ai platform: {argus}")
|
||||||
pass
|
pass
|
||||||
self.log.debug(f"switch platform: {self.config.cur_platform}")
|
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
|
@classmethod
|
||||||
def get_config_class(cls) -> Type[BaseProxyConfig]:
|
def get_config_class(cls) -> Type[BaseProxyConfig]:
|
||||||
|
|||||||
Reference in New Issue
Block a user