From 5327e9b5720737a498d87a3fd36b31e62517ae49 Mon Sep 17 00:00:00 2001 From: taylor Date: Sun, 13 Oct 2024 19:23:40 +0800 Subject: [PATCH] =?UTF-8?q?add:=20=E6=B7=BB=E5=8A=A0=E5=91=BD=E4=BB=A4ai?= =?UTF-8?q?=20model=20list=E7=9A=84=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- maubot_llmplus/aibot.py | 4 ++++ maubot_llmplus/local_paltform.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/maubot_llmplus/aibot.py b/maubot_llmplus/aibot.py index fdb0d9e..eafb3ad 100644 --- a/maubot_llmplus/aibot.py +++ b/maubot_llmplus/aibot.py @@ -75,6 +75,10 @@ class AiBotPlugin(Plugin): if event.sender == self.client.mxid: return False + # 如果发送的消息中,第一个字符是感叹号,不进行回复 + if event.content[0] == '!': + return False + # 判断这个用户是否在允许列表中, 不存在返回False # 如果列表为空, 继续往下执行 if not self.is_allow(event.sender): diff --git a/maubot_llmplus/local_paltform.py b/maubot_llmplus/local_paltform.py index 08702de..7cee119 100644 --- a/maubot_llmplus/local_paltform.py +++ b/maubot_llmplus/local_paltform.py @@ -47,7 +47,7 @@ class Ollama(Platform): if response.status != 200: return [] response_data = await response.json() - return [f"{i + 1}: {model['name']}" for i, model in enumerate(response_data['models'])] + return [f"- {model['model']}" for model in response_data['models']] def get_type(self) -> str: return "local_ai"