Add read-only production runtime audit
This commit is contained in:
@@ -227,11 +227,13 @@ function toCitations(raw: RagCitation[]): Citation[] {
|
||||
export async function POST(request: Request) {
|
||||
let content: string;
|
||||
let conversationId: string | null = null;
|
||||
let responseMode: "ai" | "monograph" = "ai";
|
||||
try {
|
||||
const body = await request.json();
|
||||
content = typeof body?.content === "string" ? body.content.trim() : "";
|
||||
conversationId =
|
||||
typeof body?.conversationId === "string" ? body.conversationId : null;
|
||||
responseMode = body?.responseMode === "monograph" ? "monograph" : "ai";
|
||||
} catch {
|
||||
return NextResponse.json({ error: "invalid_body" }, { status: 400 });
|
||||
}
|
||||
@@ -277,6 +279,7 @@ export async function POST(request: Request) {
|
||||
subject_scope: "human",
|
||||
intent: "fact_lookup",
|
||||
conversation_id: conversationId,
|
||||
response_mode: responseMode,
|
||||
}),
|
||||
cache: "no-store",
|
||||
// Propagate a browser disconnect/Stop action to the upstream fetch.
|
||||
|
||||
Reference in New Issue
Block a user