- Added multi-provider AI infrastructure (OpenAI/Ollama) - Implemented real-time tag suggestions with debounced analysis - Created AI diagnostics and database maintenance tools in Settings - Added automated garbage collection for orphan labels - Refined UX with deterministic color hashing and interactive ghost tags
28 lines
843 B
TypeScript
28 lines
843 B
TypeScript
import { NextResponse } from 'next/server';
|
|
import { getAIProvider } from '@/lib/ai/factory';
|
|
|
|
export async function GET() {
|
|
try {
|
|
const provider = getAIProvider();
|
|
const providerName = process.env.AI_PROVIDER || 'openai';
|
|
|
|
// Test simple de génération de tags sur un texte bidon
|
|
const testContent = "J'adore cuisiner des pâtes le dimanche soir avec ma famille.";
|
|
const tags = await provider.generateTags(testContent);
|
|
|
|
return NextResponse.json({
|
|
status: 'success',
|
|
provider: providerName,
|
|
test_tags: tags,
|
|
message: 'Infrastructure IA opérationnelle'
|
|
});
|
|
} catch (error: any) {
|
|
console.error('Erreur test IA détaillée:', error);
|
|
return NextResponse.json({
|
|
status: 'error',
|
|
message: error.message,
|
|
stack: error.stack
|
|
}, { status: 500 });
|
|
}
|
|
}
|