refactor(atom-extraction): remove assistant name hint and enforce role extraction from text
This commit is contained in:
@@ -61,7 +61,7 @@ const SYSTEM_PROMPT = `你是场景摘要器。从一轮对话中提取1-2个场
|
|||||||
输入格式:
|
输入格式:
|
||||||
<round>
|
<round>
|
||||||
<user name="用户名">...</user>
|
<user name="用户名">...</user>
|
||||||
<assistant name="角色名">...</assistant>
|
<assistant>...</assistant>
|
||||||
</round>
|
</round>
|
||||||
|
|
||||||
只输出严格JSON:
|
只输出严格JSON:
|
||||||
@@ -83,6 +83,7 @@ const SYSTEM_PROMPT = `你是场景摘要器。从一轮对话中提取1-2个场
|
|||||||
|
|
||||||
## who
|
## who
|
||||||
- 参与互动的角色正式名称,不用代词或别称
|
- 参与互动的角色正式名称,不用代词或别称
|
||||||
|
- 只从正文内容中识别角色名,不要把标签名(如 user、assistant)当作角色
|
||||||
|
|
||||||
## edges(关系三元组)
|
## edges(关系三元组)
|
||||||
- s=施事方 t=受事方 r=互动行为(10-15字)
|
- s=施事方 t=受事方 r=互动行为(10-15字)
|
||||||
@@ -218,7 +219,6 @@ async function extractAtomsForRoundWithRetry(userMessage, aiMessage, aiFloor, op
|
|||||||
|
|
||||||
const parts = [];
|
const parts = [];
|
||||||
const userName = userMessage?.name || '用户';
|
const userName = userMessage?.name || '用户';
|
||||||
const aiName = aiMessage.name || '角色';
|
|
||||||
|
|
||||||
if (userMessage?.mes?.trim()) {
|
if (userMessage?.mes?.trim()) {
|
||||||
const userText = filterText(userMessage.mes);
|
const userText = filterText(userMessage.mes);
|
||||||
@@ -226,7 +226,7 @@ async function extractAtomsForRoundWithRetry(userMessage, aiMessage, aiFloor, op
|
|||||||
}
|
}
|
||||||
|
|
||||||
const aiText = filterText(aiMessage.mes);
|
const aiText = filterText(aiMessage.mes);
|
||||||
parts.push(`<assistant name="${aiName}">\n${aiText}\n</assistant>`);
|
parts.push(`<assistant>\n${aiText}\n</assistant>`);
|
||||||
|
|
||||||
const input = `<round>\n${parts.join('\n')}\n</round>`;
|
const input = `<round>\n${parts.join('\n')}\n</round>`;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user