fix: remove references tag in output

This commit is contained in:
Han Xiao
2025-02-14 14:05:14 +08:00
parent 013ad3574f
commit 63a9bb9fe2

View File

@@ -41,13 +41,13 @@ function buildMdFromAnswer(answer: AnswerAction) {
return `[^${i + 1}]: [${escapedQuote}](${ref.url})`; return `[^${i + 1}]: [${escapedQuote}](${ref.url})`;
}).join('\n\n'); }).join('\n\n');
return `${answer.answer.replace(/\(REF_(\d+)\)/g, (_, num) => `[^${num}]`)} return `
${answer.answer.replace(/\(REF_(\d+)\)/g, (_, num) => `[^${num}]`)}
<references>
${references} ${references}
</references>`; `.trim();
} }
async function* streamTextNaturally(text: string, streamingState: StreamingState) { async function* streamTextNaturally(text: string, streamingState: StreamingState) {