Appearance
提示词注入列表 JSON 格式
用于导入导出聊天设定中的提示词注入列表。
顶层结构
json
{
"version": 1,
"promptInjectionEntries": []
}| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
version | number | 是 | 固定为 1 |
promptInjectionEntries | array | 是 | 提示词条目数组 |
条目字段
promptInjectionEntries 中每个元素的字段:
| 字段 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
title | string | 是 | - | 条目名称 |
enabled | boolean | 否 | true | 是否启用 |
depth | number | 否 | 0 | 注入深度 |
conditionType | string | 否 | "none" | 条件类型:none / plainText / regex |
sourceTypes | array of string | 条件 | ['user','character','system'] | 搜索来源数组。仅在 conditionType != none 时有意义 |
recentRoundCount | number | 条件 | 8 | 最近轮数。仅在 conditionType != none 时有意义 |
condition | string | 条件 | "" | 条件文本。仅在 conditionType != none 时有意义 |
template | string | 是 | "" | 注入模板 |
regexCaseSensitive | boolean | 否 | false | 仅 regex 条件时有意义,表示是否区分大小写 |
说明:
conditionType == none时,表示无条件注入。conditionType == plainText时,condition使用提示词注入的普通匹配语法,不是简单字面量匹配。conditionType == regex时,condition为正则表达式。
条目约束
title不能为空。conditionType == none时:sourceTypes/recentRoundCount/condition可省略。conditionType != none时:sourceTypes至少需要一个来源。recentRoundCount必须大于0。condition不能为空。conditionType == plainText时,condition必须是合法普通匹配表达式。conditionType == regex时,condition必须是合法正则表达式。template必须是合法提示词模板。- 提示词注入模板支持
{{变量}}/{{expr}}/{{if}}/{{when}}。 - 提示词注入模板不支持
{{set}}/{{command}}/ 消息内置变量。 {{MatchN}}仅在conditionType == regex时可用。
最小示例
json
{
"version": 1,
"promptInjectionEntries": [
{
"title": "无条件人格补充",
"template": "你要记住用户喜欢安静、克制的表达方式。"
}
]
}完整示例
json
{
"version": 1,
"promptInjectionEntries": [
{
"title": "无条件设定补充",
"template": "当前世界观偏现代都市,避免突然引入超自然设定。"
},
{
"title": "普通匹配:吃醋话题",
"enabled": true,
"depth": 0,
"conditionType": "plainText",
"sourceTypes": ["user", "character"],
"recentRoundCount": 6,
"condition": "吃醋 | 嫉妒 | 占有欲",
"template": "当话题涉及关系竞争时,优先表现细腻的情绪波动,而不是立刻升级冲突。"
},
{
"title": "正则匹配:地点切换",
"enabled": true,
"depth": -1,
"conditionType": "regex",
"sourceTypes": ["user"],
"recentRoundCount": 4,
"condition": "去(海边|学校|咖啡馆)",
"template": "当前用户提到了地点 {{Match1}},回复中应自然带入该场景的环境细节。",
"regexCaseSensitive": false
}
]
}AI 生成约束
- 每条
title不能为空。 - 若
conditionType != none: - 必须同时考虑
sourceTypes、recentRoundCount、condition三个字段。 recentRoundCount必须大于0。- 普通匹配使用提示词注入的普通匹配语法,不要误写成场景规则那种简单
A|B|C字面量匹配。 - 若模板使用
{{Match1}}等捕获变量,条件类型必须是regex。 - 不要在模板中写
{{set ...}}或{{command ...}}。
常见错误
- 某条
title为空 → 导入失败 conditionType非法 → 导入失败sourceTypes不是数组或包含非法值 → 导入失败recentRoundCount <= 0→ 导入失败conditionType != none但condition为空 → 导入失败plainText条件语法非法 → 导入失败并提示解析错误regex条件不是合法正则 → 导入失败并提示编译错误template非法或使用了不支持的模板能力 → 导入失败