async function summarize() { const text = document.getElementById("inputText").value; const response = await fetch("/summarize/text", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ text: text }) }); const data = await response.json(); document.getElementById("result").innerText = data.summary; }