mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-05-06 20:42:43 +08:00
refactor(agent): 重命名 can_edit_message 为 is_auto_flushing 更贴切语义
This commit is contained in:
@@ -348,9 +348,9 @@ class StreamingHandler:
|
||||
return self._streaming_enabled
|
||||
|
||||
@property
|
||||
def can_edit_message(self) -> bool:
|
||||
def is_auto_flushing(self) -> bool:
|
||||
"""
|
||||
是否支持消息编辑(实时推送),即定时刷新任务正在运行
|
||||
是否正在定时刷新(渠道支持消息编辑时自动推送 buffer 内容)
|
||||
"""
|
||||
return self._flush_task is not None
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@ class MoviePilotTool(BaseTool, metaclass=ABCMeta):
|
||||
# 发送工具执行过程消息
|
||||
if self._stream_handler and self._stream_handler.is_streaming:
|
||||
if settings.AI_AGENT_VERBOSE:
|
||||
if self._stream_handler.can_edit_message:
|
||||
if self._stream_handler.is_auto_flushing:
|
||||
# 渠道支持编辑:工具消息追加到 buffer,由定时刷新推送
|
||||
if tool_message:
|
||||
self._stream_handler.emit(f"\n\n⚙️ => {tool_message}\n\n")
|
||||
|
||||
Reference in New Issue
Block a user