Initial 智念AIGC platform
This commit is contained in:
13
app/api/prompt/assemble/route.ts
Normal file
13
app/api/prompt/assemble/route.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import { assemblePrompt, type PromptAssemblyInput } from "@/lib/prompt/assembler";
|
||||
import { jsonError, jsonOk, readJsonBody } from "@/lib/server/api";
|
||||
|
||||
export const runtime = "nodejs";
|
||||
|
||||
export async function POST(request: Request) {
|
||||
try {
|
||||
const body = await readJsonBody<PromptAssemblyInput & Record<string, unknown>>(request);
|
||||
return jsonOk(assemblePrompt(body));
|
||||
} catch (error) {
|
||||
return jsonError(error);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user