From 543e01c3011ede4b790012df01267bf61b6598c2 Mon Sep 17 00:00:00 2001 From: Soulter <905617992@qq.com> Date: Thu, 3 Jul 2025 15:44:45 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20webui=20=E5=88=A0=E9=99=A4=E5=AF=B9?= =?UTF-8?q?=E8=AF=9D=E4=BD=BF=E7=94=A8=20conversation=5Fmgr=EF=BC=8C?= =?UTF-8?q?=E4=BB=A5=E4=BF=9D=E6=8C=81=E7=8A=B6=E6=80=81=E5=90=8C=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- astrbot/dashboard/routes/conversation.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/astrbot/dashboard/routes/conversation.py b/astrbot/dashboard/routes/conversation.py index aa8b0af36..d73e6186a 100644 --- a/astrbot/dashboard/routes/conversation.py +++ b/astrbot/dashboard/routes/conversation.py @@ -29,6 +29,7 @@ class ConversationRoute(Route): ), } self.db_helper = db_helper + self.core_lifecycle = core_lifecycle self.register_routes() async def list_conversations(self): @@ -165,11 +166,9 @@ class ConversationRoute(Route): if not user_id or not cid: return Response().error("缺少必要参数: user_id 和 cid").__dict__ - conversation = self.db_helper.get_conversation_by_user_id(user_id, cid) - if not conversation: - return Response().error("对话不存在").__dict__ - self.db_helper.delete_conversation(user_id, cid) - + self.core_lifecycle.conversation_manager.delete_conversation( + unified_msg_origin=user_id, conversation_id=cid + ) return Response().ok({"message": "对话删除成功"}).__dict__ except Exception as e: