ai-customization #22

Merged
gpatti merged 4 commits from ai-customization into main 2026-04-13 01:13:41 +00:00
Showing only changes of commit efaff8ca1b - Show all commits

View File

@@ -533,7 +533,11 @@ export async function generateItemDescription(itemKey: string): Promise<string>
base64Images = [fs.readFileSync(thumbnailPath, 'base64')] 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) const description = await callVisionApiText(config.endpoint, describeModel, base64Images, systemPrompt)