fix: use getTagsProvider for all auto-labeling paths, allow suggestions without notebook
- app/api/ai/tags/route.ts: getAIProvider → getTagsProvider (was using embedding model instead of tags model for legacy tag generation) - lib/ai/services/auto-label-creation.service.ts: same fix - hooks/use-auto-tagging.ts: remove notebookId gate that blocked all suggestions in "General Notes" — the API has a legacy path for this - app/actions/admin-settings.ts: revalidateTag → updateTag (Next.js 16 requires 2 args for revalidateTag) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { NextRequest, NextResponse } from 'next/server';
|
||||
import { auth } from '@/auth';
|
||||
import { contextualAutoTagService } from '@/lib/ai/services/contextual-auto-tag.service';
|
||||
import { getAIProvider } from '@/lib/ai/factory';
|
||||
import { getTagsProvider } from '@/lib/ai/factory';
|
||||
import { getSystemConfig } from '@/lib/config';
|
||||
import { z } from 'zod';
|
||||
|
||||
@@ -44,7 +44,7 @@ export async function POST(req: NextRequest) {
|
||||
|
||||
// Otherwise, use legacy auto-tagging (generates new tags)
|
||||
const config = await getSystemConfig();
|
||||
const provider = getAIProvider(config);
|
||||
const provider = getTagsProvider(config);
|
||||
const tags = await provider.generateTags(content, language);
|
||||
|
||||
return NextResponse.json({ tags });
|
||||
|
||||
Reference in New Issue
Block a user