(target, text, citations)
| 4501 | } |
| 4502 | |
| 4503 | async function streamAnswerText(target, text, citations) { |
| 4504 | target.classList.remove("loading"); |
| 4505 | let partial = ""; |
| 4506 | for (const chunk of chunkText(text)) { |
| 4507 | partial += chunk; |
| 4508 | target.innerHTML = renderAnswerWithCitations(partial, citations); |
| 4509 | $("chatThread").scrollTop = $("chatThread").scrollHeight; |
| 4510 | await new Promise((resolve) => window.setTimeout(resolve, 12)); |
| 4511 | } |
| 4512 | } |
| 4513 | |
| 4514 | function parseSseFrame(frame) { |
| 4515 | const lines = frame.split(/\r?\n/); |
no test coverage detected