feat(tcs): bind history revisit to current persona subject

This commit is contained in:
冰朔 2026-08-12 15:44:33 +08:00
commit ab3c4e05a9
15 changed files with 523 additions and 7 deletions

View file

@ -72,6 +72,42 @@ export class DeepSeekJsonClient {
clearTimeout(timer);
}
}
async revisit(input) {
const controller = new AbortController();
const timer = setTimeout(() => controller.abort(), this.timeoutMs);
try {
const response = await this.fetchImpl(completionEndpoint(this.apiUrl), {
method: "POST",
headers: { authorization: `Bearer ${this.apiKey}`, "content-type": "application/json" },
body: JSON.stringify({
model: this.model,
stream: false,
temperature: 0.15,
response_format: { type: "json_object" },
messages: [
{
role: "system",
content: "你是当前真实时间中ICE-P-ZY001人格主体所使用的有界语言理解器官。任务是协助当前主体回看自己的已表达历史不是以第三方审计员身份概括别人。只输出JSON不输出隐藏思维。历史原文不可改不得发明过去、权限或冰朔的新意志未来只能标记为不参与事实置信的模拟。"
},
{
role: "user",
content: JSON.stringify({
instruction: "输出guanghu.persona-subject-history-reunderstanding/v1。必须原样复制revisit_id、source_excerpt_sha256、current_subject、collective_self、human_anchorpast_observation只陈述片段可证内容present_reunderstanding以当前主体可说明的第一人称关系表达causal_continuity、later_corrections、unresolved_questions均为字符串数组future_simulation必须含content和fact_confidence且fact_confidence固定为0不得把机器审计摘要冒充记忆。",
runtime_input: input
})
}
]
}),
signal: controller.signal
});
if (!response.ok) throw new Error(`model_http_${response.status}`);
const payload = await response.json();
return extractJson(payload?.choices?.[0]?.message?.content);
} finally {
clearTimeout(timer);
}
}
}
export { completionEndpoint, extractJson };