feat(agent): 新增AI_AGENT_VERBOSE开关,控制工具调用过程回复及提示词输出

This commit is contained in:
jxxghp
2026-03-27 20:12:01 +08:00
parent c3e96ae73f
commit 8d7ff2bd1d
4 changed files with 18 additions and 4 deletions

View File

@@ -7,6 +7,7 @@ from pydantic import PrivateAttr
from app.agent import StreamingHandler
from app.chain import ChainBase
from app.core.config import settings
from app.log import logger
from app.schemas import Notification
@@ -53,7 +54,7 @@ class MoviePilotTool(BaseTool, metaclass=ABCMeta):
if explanation:
tool_message = explanation
if not is_background:
if not is_background and settings.AI_AGENT_VERBOSE:
# 非后台模式:发送工具执行过程消息
if self._stream_handler and self._stream_handler.is_streaming:
# 流式渠道:工具消息直接追加到 buffer 中,与 Agent 文字合并为同一条流式消息