import { readModelCall, sourceOf } from "@/lib/model-log"; import { fail, ok } from "../../research/_respond"; export const dynamic = "force-dynamic"; // ONE CALL of the model log (demo epic D3): its row with every item and its // whole text -- the system prompt, the prompt, the answer (each kept to 40k // characters) -- fetched when the panel opens the row. // GET /api/model-log/call?article=&n=&id= (or job=) export async function GET(request: Request) { try { const sp = new URL(request.url).searchParams; return ok(await readModelCall(sourceOf(sp), sp.get("id")?.trim() ?? "")); } catch (e) { return fail(e); } }