ai-customization #22
@@ -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)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user