From ce975aa69f40b233831293b07722bd05070fbcad Mon Sep 17 00:00:00 2001 From: K2Cr2O1 <2221577113@qq.com> Date: Tue, 24 Mar 2026 14:57:10 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E6=8F=92=E4=BB=B6):=20=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E6=8F=92=E4=BB=B6=E5=85=83=E4=BF=A1=E6=81=AF=E5=92=8C?= =?UTF-8?q?=E5=91=BD=E4=BB=A4=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 为 AI 聊天和知识库插件添加元信息配置 - 简化插件命令配置,移除冗余别名 - 更新 Discord 适配器的 Redis 频道名称 - 增强向量数据库管理器的日志信息 --- plugins/ai_chat.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/plugins/ai_chat.py b/plugins/ai_chat.py index 1e94bcf..92c7c5f 100644 --- a/plugins/ai_chat.py +++ b/plugins/ai_chat.py @@ -12,6 +12,12 @@ from core.config_loader import global_config logger = ModuleLogger("AIChat") +__plugin_meta__ = { + "name": "AI 聊天", + "description": "支持向量数据库记忆功能的 AI 聊天助手", + "usage": "/chat <内容> - 与 AI 进行对话" +} + # 尝试导入 OpenAI 客户端 try: from openai import AsyncOpenAI @@ -97,7 +103,7 @@ async def get_ai_response(user_id: int, group_id: int, user_message: str) -> str logger.error(f"AI 聊天请求失败: {e}") return f"请求失败: {str(e)}" -@matcher.command("chat", "聊天") +@matcher.command("chat") async def chat_command(event: GroupMessageEvent | PrivateMessageEvent, args: list[str]): """AI 聊天命令""" if not args: