This commit is contained in:
Zacharias-Brohn
2026-01-14 23:09:04 +01:00
parent b3bf148474
commit 2887feaed5
2 changed files with 16 additions and 1 deletions
+6
View File
@@ -13,6 +13,9 @@ export async function POST(request: NextRequest) {
try {
const { model, messages } = await request.json();
// eslint-disable-next-line no-console
console.log('[Title API] Request received:', { model, messageCount: messages?.length });
if (!model || !messages || !Array.isArray(messages) || messages.length === 0) {
return NextResponse.json({ error: 'Model and messages array are required' }, { status: 400 });
}
@@ -54,6 +57,9 @@ export async function POST(request: NextRequest) {
title = firstUserMessage.slice(0, 30) + (firstUserMessage.length > 30 ? '...' : '');
}
// eslint-disable-next-line no-console
console.log('[Title API] Generated title:', title);
return NextResponse.json({ title });
} catch (error) {
// eslint-disable-next-line no-console