(env, key, label, fallback = "", aliases = [])
| 4888 | await searchWiki(); |
| 4889 | } |
| 4890 | |
| 4891 | function chunkText(text) { |
| 4892 | const content = String(text || ""); |
| 4893 | if (!content) return [""]; |
| 4894 | const chunks = []; |
| 4895 | for (let index = 0; index < content.length; index += 12) { |
| 4896 | chunks.push(content.slice(index, index + 12)); |
| 4897 | } |
| 4898 | return chunks; |
| 4899 | } |
| 4900 | |
| 4901 | async function streamAnswerText(target, text, citations) { |
| 4902 | target.classList.remove("loading"); |
| 4903 | let partial = ""; |
| 4904 | for (const chunk of chunkText(text)) { |
no test coverage detected