mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-07-13 00:13:02 +08:00
feat(agent): 新增AI_AGENT_VERBOSE开关,控制工具调用过程回复及提示词输出
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
from pathlib import Path
|
||||
from typing import Dict
|
||||
|
||||
from app.core.config import settings
|
||||
from app.log import logger
|
||||
from app.schemas import (
|
||||
ChannelCapability,
|
||||
@@ -73,6 +74,14 @@ class PromptManager:
|
||||
# 始终替换占位符,避免后续 .format() 时因残留花括号报 KeyError
|
||||
base_prompt = base_prompt.replace("{markdown_spec}", markdown_spec)
|
||||
|
||||
# 据 VERBOSE 开关动态调整提示词:关闭时要求避免工具调用前的废话
|
||||
if not settings.AI_AGENT_VERBOSE:
|
||||
base_prompt += (
|
||||
"\n\n[Important Instruction] If you need to call a tool, DO NOT output any conversational "
|
||||
"text or explanations before calling the tool. Call the tool directly without transitional "
|
||||
"phrases like 'Let me check', 'I will look this up', etc."
|
||||
)
|
||||
|
||||
return base_prompt
|
||||
|
||||
@staticmethod
|
||||
|
||||
Reference in New Issue
Block a user