add: 添加命令ai model list的逻辑
This commit is contained in:
@@ -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):
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user