MCPcopy Create free account
hub / github.com/OpenRaiser/PaperFlow / renderAnswerMeta

Function renderAnswerMeta

deployments/desktop/static/desktop.js:4229–4240  ·  view source on GitHub ↗
(data = {}, citations = [])

Source from the content-addressed store, hash-verified

4227 }
4228
4229 function renderAnswerMeta(data = {}, citations = []) {
4230 const wikiMode = data.retrieval_required !== false && data.mode !== "direct";
4231 const modeText = wikiMode ? ui().chat.referencesCount(citations.length) : ui().chat.directAnswer;
4232 const route = wikiMode && data.routing_reason !== "mention_required" ? "" : routingLabel(data.routing_reason);
4233 return `
4234 <div class="answer-meta">
4235 <span class="${wikiMode ? "wiki" : "direct"}">${escapeHtml(modeText)}</span>
4236 ${route ? `<span>${escapeHtml(route)}</span>` : ""}
4237 <span>${escapeHtml(ui().chat.streamOutput)}</span>
4238 </div>
4239 `;
4240 }
4241
4242 function renderChatSources(sources = DEMO_MODE ? demoSources : []) {
4243 const items = Array.isArray(sources) ? sources.map((source, index) => normalizeCitationSource(source, index)) : [];

Callers 3

renderChatMessagesFunction · 0.85
processFrameFunction · 0.85
askWikiFunction · 0.85

Calls 3

uiFunction · 0.85
routingLabelFunction · 0.85
escapeHtmlFunction · 0.70

Tested by

no test coverage detected