(data = {}, citations = [])
| 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)) : []; |
no test coverage detected