feat: 自适应支线插入引擎(WIP:scoring/branching 抽取、挂点重定向、10 条支线 JSON、决策落库)
This commit is contained in:
@@ -51,7 +51,7 @@ const chapters = [1, 2, 3].map(
|
||||
// --- 1. C1-01 身份抽取(走引擎真实代码路径) ---
|
||||
const store = new MemoryStore();
|
||||
const engine = new StoryEngine(chapters, store, jev);
|
||||
while (engine.currentNode().type !== 'identity') engine.advance();
|
||||
while (engine.currentNode().type !== 'identity') await engine.advance();
|
||||
const intro = '我叫林晚,今年29岁,在杭州一家互联网公司做产品经理,硕士毕业五年了。';
|
||||
const profile = await engine.extractIdentity(intro);
|
||||
console.log('\n[1] C1-01 身份抽取');
|
||||
@@ -60,7 +60,7 @@ console.log(' 抽取:', JSON.stringify(profile));
|
||||
|
||||
// --- 2. C1-02 情绪签名 → 场景变体(choice 格式实测) ---
|
||||
await engine.confirmIdentity(profile);
|
||||
while (engine.currentNode().type !== 'narration') engine.advance();
|
||||
while (engine.currentNode().type !== 'narration') await engine.advance();
|
||||
const farewell = '外婆走的那天我在外地考试,没赶上最后一面。后来我每年清明都回去,院子里的桂花树还在。';
|
||||
let result = await engine.submitNarration(farewell);
|
||||
console.log('\n[2] C1-02 情绪签名 → 场景变体');
|
||||
|
||||
Reference in New Issue
Block a user