Merge branch 'refactor-hot-load'

This commit is contained in:
Soulter
2025-02-23 17:04:36 +08:00
2 changed files with 12 additions and 3 deletions
+1 -1
View File
@@ -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():
# 事件没有终止传播
+11 -2
View File
@@ -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:
'''