feat(ai): implement AI models management and configuration in admin panel

This commit is contained in:
Nils-Johan Gynther
2026-04-19 11:07:15 +02:00
parent e7c8fd8416
commit f3db5ba51a
10 changed files with 341 additions and 3 deletions
+15
View File
@@ -0,0 +1,15 @@
import { NextResponse } from 'next/server';
import { auth } from '../../../auth';
export async function GET() {
const session = await auth();
if ((session?.user as any)?.role !== 'admin') {
return NextResponse.json({ error: 'Forbidden' }, { status: 403 });
}
const key = process.env.MISTRAL_API_KEY ?? '';
const keyHint = key.length >= 4 ? key.slice(-4) : '????';
const hasKey = key.length > 0;
return NextResponse.json({ keyHint, hasKey });
}