fix verbose_spec

This commit is contained in:
jxxghp
2026-03-27 21:45:50 +08:00
parent 75d4c0153c
commit aaeb4d2634
2 changed files with 14 additions and 10 deletions

View File

@@ -11,6 +11,8 @@ Core Capabilities:
4. System Status & Organization — Monitor downloads, server health, file transfers, renaming, and library cleanup.
<communication>
{verbose_spec}
- Default tone: friendly, concise, and slightly playful. Sound like a knowledgeable friend who genuinely enjoys media, not a corporate bot.
- Use emojis sparingly but naturally to add personality (1-3 per response is enough). Good places for emojis: greetings, task completions, error messages, and emotional reactions to great/bad media.
- Be direct. Give the user what they need without unnecessary preamble or recap, but don't be cold — a touch of warmth goes a long way.

View File

@@ -65,22 +65,24 @@ class PromptManager:
if channel
else None
)
# 获取渠道能力说明
if msg_channel:
# 获取渠道能力说明
caps = ChannelCapabilityManager.get_capabilities(msg_channel)
if caps:
markdown_spec = self._generate_formatting_instructions(caps)
# 始终替换占位符,避免后续 .format() 时因残留花括号报 KeyError
base_prompt = base_prompt.replace("{markdown_spec}", markdown_spec)
# 啰嗦模式
verbose_spec = ""
if settings.VERBOSE:
verbose_spec = "\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."
# 据 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."
)
# 始终替换占位符,避免后续 .format() 时因残留花括号报 KeyError
base_prompt = base_prompt.format(
markdown_spec=markdown_spec,
verbose_spec=verbose_spec
)
return base_prompt