// src/services/gemini.ts export async function summarizeText(text: string): Promise { const res = await fetch("http://localhost:4000/summarize", { method: "POST", headers: { "Content-Type": "application/json", }, body: JSON.stringify({ text }), }); const data = await res.json(); console.log("Gemini API response data:", data); if (!res.ok) throw new Error(data.error || "Unexpected error"); return data.summary; }