diff --git a/src/lib/ai-tagger.ts b/src/lib/ai-tagger.ts index b83211c..fc04423 100644 --- a/src/lib/ai-tagger.ts +++ b/src/lib/ai-tagger.ts @@ -533,7 +533,11 @@ export async function generateItemDescription(itemKey: string): Promise base64Images = [fs.readFileSync(thumbnailPath, 'base64')] } - const systemPrompt = `You are a media cataloging assistant. Describe the given image briefly and objectively in 1-3 sentences.${config.promptDescribe ? ' ' + config.promptDescribe : ''}` + const { tags: currentTags } = getResolvedTagsForItem(itemKey) + const tagContext = currentTags.length > 0 + ? ` This content has the following tags applied describing it: ${currentTags.map((t) => t.name).join(', ')}. Use these as additional context and treat them as a source of truth, overriding any conflicting assumptions made from the image.` + : '' + const systemPrompt = `You are a media cataloging assistant. Describe the given image briefly and objectively in 1-3 sentences.${config.promptDescribe ? ' ' + config.promptDescribe : ''}${tagContext}` const description = await callVisionApiText(config.endpoint, describeModel, base64Images, systemPrompt)