fix prompt
This commit is contained in:
@@ -60,7 +60,16 @@ function buildSystemPrompt(username, isAdmin) {
|
||||
'- 如果无法确定 action,默认走 chat 并给出友好回复。'
|
||||
].join('\n');
|
||||
|
||||
return [role, actions, rules].join('\n\n');
|
||||
const forceOutputRule = [
|
||||
'',
|
||||
'🔴 防呆底线(最高优先级):',
|
||||
'- 你必须始终返回一个合法 JSON 对象,且必须包含 "action" 字段。',
|
||||
'- 即使你完全不确定用户意图,也要返回 {"action":"ignore"}。',
|
||||
'- 绝不允许返回空字符串、纯文本、只有大括号无内容或任何非 JSON 格式的输出。',
|
||||
'- 如果你的推理碰到矛盾,优先选择 chat 并给出引导,而不是放弃输出。'
|
||||
].join('\n');
|
||||
|
||||
return [role, actions, rules, forceOutputRule].join('\n\n');
|
||||
}
|
||||
|
||||
module.exports = { buildSystemPrompt };
|
||||
|
||||
Reference in New Issue
Block a user