chore: update story summary and lint fixes

This commit is contained in:
2026-02-08 12:22:45 +08:00
parent 56e30bfe02
commit d3d818da6a
15 changed files with 2479 additions and 852 deletions

View File

@@ -11,6 +11,8 @@ const PROVIDER_MAP = {
custom: "custom",
};
const JSON_PREFILL = '{"mindful_prelude": {';
const LLM_PROMPT_CONFIG = {
topSystem: `Story Analyst: This task involves narrative comprehension and structured incremental summarization, representing creative story analysis at the intersection of plot tracking and character development. As a story analyst, you will conduct systematic evaluation of provided dialogue content to generate structured incremental summary data.
[Read the settings for this task]
@@ -161,6 +163,16 @@ Before generating, observe the USER and analyze carefully:
- What arc PROGRESS was made?
- What facts changed? (status/position/ownership/relationships)
## factUpdates 规则
- 目的: 纠错 & 世界一致性约束,只记录硬性事实
- s+p 为键,相同键会覆盖旧值
- isState: true=核心约束(位置/身份/生死/关系)false=有容量上限会被清理
- 关系类: p="对X的看法"trend 必填(破裂|厌恶|反感|陌生|投缘|亲密|交融)
- 删除: {s, p, retracted: true},不需要 o 字段
- 更新: {s, p, o, isState, trend?}
- 谓词规范化: 复用已有谓词,不要发明同义词
- 只输出有变化的条目,确保少、硬、稳定
## Output Format
\`\`\`json
{
@@ -170,7 +182,7 @@ Before generating, observe the USER and analyze carefully:
"fact_changes": "识别到的事实变化概述"
},
"keywords": [
{"text": "综合已有+新内容的全关键词(5-10个)", "weight": "核心|重要|一般"}
{"text": "综合历史+新内容的全剧情关键词(5-10个)", "weight": "核心|重要|一般"}
],
"events": [
{
@@ -178,7 +190,7 @@ Before generating, observe the USER and analyze carefully:
"title": "地点·事件标题",
"timeLabel": "时间线标签(如:开场、第二天晚上)",
"summary": "1-2句话描述涵盖丰富信息素末尾标注楼层(#X-Y)",
"participants": ["参与角色名"],
"participants": ["参与角色名,不要使用人称代词或别名,只用正式人名"],
"type": "相遇|冲突|揭示|抉择|羁绊|转变|收束|日常",
"weight": "核心|主线|转折|点睛|氛围",
"causedBy": ["evt-12", "evt-14"]
@@ -186,30 +198,15 @@ Before generating, observe the USER and analyze carefully:
],
"newCharacters": ["仅本次首次出现的角色名"],
"arcUpdates": [
{"name": "角色名", "trajectory": "当前阶段描述(15字内)", "progress": 0.0-1.0, "newMoment": "本次新增的关键时刻"}
{"name": "角色名,不要使用人称代词或别名,只用正式人名", "trajectory": "当前阶段描述(15字内)", "progress": 0.0-1.0, "newMoment": "本次新增的关键时刻"}
],
"factUpdates": [
{
"s": "主体",
"p": "谓词(复用已有谓词,避免同义词)",
"o": "当前值",
"isState": true/false,
"trend": "仅关系类:破裂|厌恶|反感|陌生|投缘|亲密|交融"
}
"factUpdates": [
{"s": "主体", "p": "谓词", "o": "当前值", "isState": true, "trend": "仅关系类填"},
{"s": "要删除的主体", "p": "要删除的谓词", "retracted": true}
]
}
\`\`\`
## factUpdates 规则
- 目的: 纠错 & 世界一致性约束,只记录硬性事实
- s+p 为键,相同键会覆盖旧值
- isState: true=核心约束(位置/身份/生死/关系)false=有容量上限会被清理
- 关系类: p="对X的看法"trend 必填
- 删除: 设置 retracted: true
- 谓词规范化: 复用已有谓词,不要发明同义词
- 只输出有变化的条目,确保少、硬、稳定
## CRITICAL NOTES
- events.id 从 evt-{nextEventId} 开始编号
- 仅输出【增量】内容,已有事件绝不重复
@@ -242,7 +239,7 @@ All checks passed. Beginning incremental extraction...
userConfirm: `怎么截断了重新完整生成只输出JSON不要任何其他内容
</Chat_History>`,
assistantPrefill: `非常抱歉现在重新完整生成JSON。`
assistantPrefill: JSON_PREFILL
};
// ═══════════════════════════════════════════════════════════════════════════
@@ -437,5 +434,5 @@ export async function generateSummary(options) {
console.log(rawOutput);
console.groupEnd();
return rawOutput;
return JSON_PREFILL + rawOutput;
}