(text)
| 4491 | } |
| 4492 | |
| 4493 | function chunkText(text) { |
| 4494 | const content = String(text || ""); |
| 4495 | if (!content) return [""]; |
| 4496 | const chunks = []; |
| 4497 | for (let index = 0; index < content.length; index += 12) { |
| 4498 | chunks.push(content.slice(index, index + 12)); |
| 4499 | } |
| 4500 | return chunks; |
| 4501 | } |
| 4502 | |
| 4503 | async function streamAnswerText(target, text, citations) { |
| 4504 | target.classList.remove("loading"); |