(data)
| 4202 | } |
| 4203 | |
| 4204 | function normalizeCitations(data) { |
| 4205 | const raw = Array.isArray(data?.citations) && data.citations.length ? data.citations : data?.sources; |
| 4206 | const items = Array.isArray(raw) ? raw : DEMO_MODE ? demoSources : []; |
| 4207 | return items.map((source, index) => normalizeCitationSource(source, index)); |
| 4208 | } |
| 4209 | |
| 4210 | function renderAnswerWithCitations(text, citations = []) { |
| 4211 | const refs = new Map(citations.map((citation) => [String(citation.index), citation])); |
no test coverage detected