fix: auto-tagging provider resolution, email test flow, language detection
Auto-tagging: - CRITICAL FIX: contextual-auto-tag.service.ts was calling getAIProvider() (alias for getEmbeddingsProvider) instead of getTagsProvider(). This meant auto-tagging used the embeddings provider/model instead of the tags one. Now correctly uses getTagsProvider() in both suggestFromExistingLabels and suggestNewLabels methods. - Pass user's detected language to suggestLabels() for localized prompts (was hardcoded to 'en') Email: - Fix Resend "from" field: pass DB config to sendViaResend() instead of re-fetching from DB. Uses SMTP_FROM from config, with localhost-aware fallback. - Add "Sender email" field in admin Resend section so users can set SMTP_FROM - Save SMTP_FROM when Resend is selected (was only saved for SMTP mode) - Test email button now saves config to DB BEFORE testing, so unsaved form values are used (was reading stale DB values) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
*/
|
||||
|
||||
import { prisma } from '@/lib/prisma'
|
||||
import { getAIProvider } from '@/lib/ai/factory'
|
||||
import { getTagsProvider } from '@/lib/ai/factory'
|
||||
import { getSystemConfig } from '@/lib/config'
|
||||
|
||||
export interface LabelSuggestion {
|
||||
@@ -77,7 +77,7 @@ export class ContextualAutoTagService {
|
||||
|
||||
try {
|
||||
const config = await getSystemConfig()
|
||||
const provider = getAIProvider(config)
|
||||
const provider = getTagsProvider(config)
|
||||
|
||||
// Use generateText with JSON response
|
||||
const response = await provider.generateText(prompt)
|
||||
@@ -161,7 +161,7 @@ export class ContextualAutoTagService {
|
||||
|
||||
try {
|
||||
const config = await getSystemConfig()
|
||||
const provider = getAIProvider(config)
|
||||
const provider = getTagsProvider(config)
|
||||
|
||||
// Use generateText with JSON response
|
||||
const response = await provider.generateText(prompt)
|
||||
|
||||
Reference in New Issue
Block a user