mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-06-09 01:31:05 +08:00
refine tool提示语为更简洁风格,补充last_buffer_char属性及非VERBOSE模式流式输出换行逻辑,新增工具流式分隔符单元测试
This commit is contained in:
@@ -81,7 +81,10 @@ class MoviePilotTool(BaseTool, metaclass=ABCMeta):
|
||||
if messages:
|
||||
merged_message = "\n\n".join(messages)
|
||||
await self.send_tool_message(merged_message)
|
||||
# 非VERBOSE:不重置流,保留已输出的模型思考文本
|
||||
else:
|
||||
# 非VERBOSE:工具边界至少补一个换行,避免工具前后的文本直接连在一起
|
||||
if self._stream_handler.last_buffer_char not in ("", "\n"):
|
||||
self._stream_handler.emit("\n")
|
||||
else:
|
||||
# 未启用流式传输,不发送任何工具消息内容
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user