From 11e9d47ce28650b1e4226cef62ff8f4794a79231 Mon Sep 17 00:00:00 2001 From: Soulter <905617992@qq.com> Date: Thu, 27 Feb 2025 00:26:04 +0800 Subject: [PATCH] fix: dify active message error #616 --- astrbot/core/pipeline/process_stage/method/llm_request.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/astrbot/core/pipeline/process_stage/method/llm_request.py b/astrbot/core/pipeline/process_stage/method/llm_request.py index 9b5617340..ce998e7cb 100644 --- a/astrbot/core/pipeline/process_stage/method/llm_request.py +++ b/astrbot/core/pipeline/process_stage/method/llm_request.py @@ -142,6 +142,9 @@ class LLMRequestSubStage(Stage): return async def _save_to_history(self, event: AstrMessageEvent, req: ProviderRequest, llm_response: LLMResponse): + if not req or not req.conversation or not llm_response or not req.contexts: + return + if llm_response.role == "assistant": # 文本回复 contexts = req.contexts