import type { AsyncRes } from "sortug"; export async function ocr(formData: FormData): AsyncRes { const endpoint = "http://localhost:8102/ocr"; const opts = { method: "POST", body: formData, headers: { "X-API-KEY": Bun.env.SORTUG_NLP_API_KEY! }, }; try { const res = await fetch(endpoint, opts); const j = await res.json(); return { ok: j }; } catch (e) { return { error: `${e}` }; } }