From f16feff17b7427bae209243e979314d31e04a635 Mon Sep 17 00:00:00 2001 From: advent259141 <2968474907@qq.com> Date: Sat, 28 Jun 2025 16:59:00 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=B9=E6=8D=AE=E4=BC=9A=E8=AF=9Dmcp?= =?UTF-8?q?=E5=BC=80=E5=85=B3=E6=83=85=E5=86=B5=E9=80=89=E6=8B=A9=E6=80=A7?= =?UTF-8?q?=E4=BC=A0=E5=85=A5=20func=5Ftool=20=E4=BF=AE=E6=94=B9import?= =?UTF-8?q?=E7=9A=84=E4=BD=8D=E7=BD=AE=20deleted:=20=20=20=20astrbot/core/?= =?UTF-8?q?star/session=5Ftts=5Fmanager.py=20=E5=A4=8D=E5=8E=9F=E8=A2=AB?= =?UTF-8?q?=E8=A6=86=E7=9B=96=E7=9A=84=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/pipeline/process_stage/method/llm_request.py | 5 +++-- astrbot/core/pipeline/result_decorate/stage.py | 4 +--- astrbot/core/star/session_tts_manager.py | 0 dashboard/src/router/MainRoutes.ts | 10 +++++++++- 4 files changed, 13 insertions(+), 6 deletions(-) delete mode 100644 astrbot/core/star/session_tts_manager.py diff --git a/astrbot/core/pipeline/process_stage/method/llm_request.py b/astrbot/core/pipeline/process_stage/method/llm_request.py index 5bf53e1b8..1424a217e 100644 --- a/astrbot/core/pipeline/process_stage/method/llm_request.py +++ b/astrbot/core/pipeline/process_stage/method/llm_request.py @@ -101,7 +101,8 @@ class LLMRequestSubStage(Stage): if not event.message_str.startswith(self.provider_wake_prefix): return req.prompt = event.message_str[len(self.provider_wake_prefix) :] - req.func_tool = self.ctx.plugin_manager.context.get_llm_tool_manager() + if SessionServiceManager.should_process_mcp_request(event): + req.func_tool = self.ctx.plugin_manager.context.get_llm_tool_manager() for comp in event.message_obj.message: if isinstance(comp, Image): image_path = await comp.convert_to_file_path() @@ -471,7 +472,7 @@ class LLMRequestSubStage(Stage): ) ) continue - + logger.info( f"从 MCP 服务 {func_tool.mcp_server_name} 调用工具函数:{func_tool.name},参数:{func_tool_args}" ) diff --git a/astrbot/core/pipeline/result_decorate/stage.py b/astrbot/core/pipeline/result_decorate/stage.py index 82d6750e7..6ec90fdb7 100644 --- a/astrbot/core/pipeline/result_decorate/stage.py +++ b/astrbot/core/pipeline/result_decorate/stage.py @@ -8,6 +8,7 @@ from astrbot.core.message.components import At, File, Image, Node, Plain, Record from astrbot.core.message.message_event_result import ResultContentType from astrbot.core.platform.astr_message_event import AstrMessageEvent from astrbot.core.platform.message_type import MessageType +from astrbot.core.star.session_llm_manager import SessionServiceManager from astrbot.core.star.star import star_map from astrbot.core.star.star_handler import EventType, star_handlers_registry @@ -177,9 +178,6 @@ class ResultDecorateStage(Stage): event.unified_msg_origin ) - # 导入SessionServiceManager以检查会话级TTS开关 - from astrbot.core.star.session_llm_manager import SessionServiceManager - if ( self.ctx.astrbot_config["provider_tts_settings"]["enable"] and result.is_llm_result() diff --git a/astrbot/core/star/session_tts_manager.py b/astrbot/core/star/session_tts_manager.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/dashboard/src/router/MainRoutes.ts b/dashboard/src/router/MainRoutes.ts index e4a0fcb9c..6cd9b5812 100644 --- a/dashboard/src/router/MainRoutes.ts +++ b/dashboard/src/router/MainRoutes.ts @@ -85,7 +85,15 @@ const MainRoutes = { { name: 'Chat', path: '/chat', - component: () => import('@/views/ChatPage.vue') + component: () => import('@/views/ChatPage.vue'), + children: [ + { + path: ':conversationId', + name: 'ChatDetail', + component: () => import('@/views/ChatPage.vue'), + props: true + } + ] }, { name: 'Settings',