diff --git a/astrbot/core/pipeline/process_stage/stage.py b/astrbot/core/pipeline/process_stage/stage.py index f93be8108..c22ab4d92 100644 --- a/astrbot/core/pipeline/process_stage/stage.py +++ b/astrbot/core/pipeline/process_stage/stage.py @@ -45,7 +45,7 @@ class ProcessStage(Stage): if not self.ctx.astrbot_config['provider_settings'].get('enable', True): return - if not event._has_send_oper and event.is_at_or_wake_command: + if not event._has_send_oper and event.is_at_or_wake_command and not event.call_llm: # 是否有过发送操作 and 是否是被 @ 或者通过唤醒前缀 if (event.get_result() and not event.get_result().is_stopped()) or not event.get_result(): # 事件没有终止传播 diff --git a/astrbot/core/platform/astr_message_event.py b/astrbot/core/platform/astr_message_event.py index d650ba840..0500d0279 100644 --- a/astrbot/core/platform/astr_message_event.py +++ b/astrbot/core/platform/astr_message_event.py @@ -57,7 +57,8 @@ class AstrMessageEvent(abc.ABC): self._has_send_oper = False '''是否有过至少一次发送操作''' - + self.call_llm = False + '''是否在此消息事件中禁止默认的 LLM 请求''' # back_compability self.platform = platform_meta @@ -242,7 +243,15 @@ class AstrMessageEvent(abc.ABC): ''' if self._result is None: return False # 默认是继续传播 - return self._result.is_stopped() + return self._result.is_stopped() + + def should_call_llm(self, call_llm: bool): + ''' + 是否在此消息事件中禁止默认的 LLM 请求。 + + 只会阻止 AstrBot 默认的 LLM 请求链路,不会阻止插件中的 LLM 请求。 + ''' + self.call_llm = call_llm def get_result(self) -> MessageEventResult: '''