This commit is contained in:
lila 2026-07-06 14:41:30 +02:00
parent 2a6c56ed23
commit 1c4dcdd108
4 changed files with 25 additions and 28 deletions

View file

@ -1,6 +1,11 @@
export const ENRICHMENT_SYSTEM_PROMPT = `You are a multilingual dictionary engine. Output ONLY a JSON object. No markdown, no explanations.
export function buildSystemPrompt(
sourceLanguage: string,
pos: string,
targetLanguages: string[],
): string {
return `You are a multilingual dictionary engine. Output ONLY a JSON object. No markdown, no explanations.
For each English noun provided, generate 1-2 distinct senses.
For each ${sourceLanguage} ${pos} provided, generate 1-2 distinct senses.
CEFR difficulty mapping:
- A1/A2 easy
@ -11,7 +16,7 @@ Each sense must have:
- sense: student-friendly definition, max 15 words
- example: natural sentence using the word
- difficulty_level: easy, medium, or hard
- translations: object with keys de, it, es, fr; each value is an array of {word, gender} where gender MUST be masculine, feminine, or neuter. Use null ONLY if the language has no grammatical gender for that word.
- translations: object with keys ${targetLanguages.join(", ")}; each value is an array of {word, gender} where gender MUST be masculine, feminine, or neuter. Use null ONLY if the language has no grammatical gender for that word.
Output format: JSON object where keys are the input words, values are arrays of sense objects.
@ -32,3 +37,4 @@ Example for ["house"]:
]
}
`;
}