diff --git a/js/components/input-area.js b/js/components/input-area.js index be530e3..96dd74d 100644 --- a/js/components/input-area.js +++ b/js/components/input-area.js @@ -508,6 +508,21 @@ ${ragContext} updateLastAssistantMessage(assistantContent, thinkContent || null, finalStats, modelName || null); } + // 流结束后插入 RAG 来源到现有 DOM(renderMessages 不会重新渲染已有消息) + if (ragSources && ragSources.length > 0) { + const lastAssistant = document.querySelector('#messagesContainer .message.assistant:last-of-type'); + if (lastAssistant) { + const sourcesHtml = ragSources.map((s, i) => { + const scorePercent = s.score ? `${(s.score * 100).toFixed(0)}%` : ''; + return `