add: 添加命令ai model list的逻辑
This commit is contained in:
@@ -8,6 +8,8 @@ from maubot import Plugin
|
||||
from mautrix.types import MessageEvent, EncryptedEvent
|
||||
from mautrix.util.config import BaseProxyConfig
|
||||
|
||||
from maubot_llmplus.aibot import AbsAiBotPlugin
|
||||
|
||||
"""
|
||||
AI响应对象
|
||||
"""
|
||||
@@ -60,14 +62,14 @@ class Platform:
|
||||
|
||||
|
||||
|
||||
async def get_context(plugin: Plugin, platform: Platform, evt: MessageEvent) -> deque:
|
||||
async def get_context(plugin: AbsAiBotPlugin, platform: Platform, evt: MessageEvent) -> deque:
|
||||
# 创建系统提示词上下文
|
||||
system_context = deque()
|
||||
# 生成当前时间
|
||||
timestamp = datetime.today().strftime('%Y-%m-%d %H:%M:%S')
|
||||
# 加入系统提示词
|
||||
system_prompt = {"role": "system",
|
||||
"content": plugin.config['system_prompt'].format(name=plugin.name, timestamp=timestamp)}
|
||||
"content": plugin.config['system_prompt'].format(name=plugin.get_bot_name(), timestamp=timestamp)}
|
||||
if plugin.config['enable_multi_user']:
|
||||
system_prompt["content"] += """
|
||||
User messages are in the context of multiperson chatrooms.
|
||||
|
||||
Reference in New Issue
Block a user