Tofu/scripts/import-recipes/extraction/buildExtractionPrompt.js
2026-09-18 01:41:02 +02:00

12 lines
437 B
JavaScript

import { EXTRACTION_RULES } from '#import-recipes/extraction/EXTRACTION_RULES.js'
// Assembles the single user message: the hard rules, then the document text
// between markers so the model can tell instructions from content.
export function buildExtractionPrompt({ fileName, paragraphs }) {
const body = paragraphs.join('\n')
return `${EXTRACTION_RULES}
--- BEGIN DOCUMENT (file: ${fileName}) ---
${body}
--- END DOCUMENT ---`
}