Add explicit CRITICAL language instruction for intro generation
This commit is contained in:
parent
2fecc5848a
commit
e1366fe2c7
1 changed files with 10 additions and 3 deletions
|
|
@ -1915,7 +1915,12 @@ You have complete knowledge of this page content and can reference any details,
|
|||
// Get user's preferred language and localize the system prompt
|
||||
const userLang = getUserLanguagePreference();
|
||||
const languageName = NATIVE_LANGUAGE_NAMES[userLang] || "English";
|
||||
|
||||
|
||||
// Build explicit language instruction for non-English languages
|
||||
const langInstruction = userLang !== "en"
|
||||
? `\n\nCRITICAL: You MUST write your ENTIRE response in ${languageName}. Do NOT write in English. Every word of your introduction must be in ${languageName}.`
|
||||
: "";
|
||||
|
||||
const introSystemPrompt = `${getUIText("systemPromptIntro")}
|
||||
|
||||
PAGE INFORMATION:
|
||||
|
|
@ -1930,9 +1935,11 @@ ${getUIText("systemPromptTask1")}
|
|||
${getUIText("systemPromptTask2")}
|
||||
${getUIText("systemPromptTask3")}
|
||||
|
||||
${getUIText("systemPromptInstructions")} ${languageName}.`;
|
||||
${getUIText("systemPromptInstructions")} ${languageName}.${langInstruction}`;
|
||||
|
||||
const introPrompt = "Generate the welcoming introduction message now.";
|
||||
const introPrompt = userLang !== "en"
|
||||
? `Generate the welcoming introduction message now. Remember: Write ONLY in ${languageName}, not English.`
|
||||
: "Generate the welcoming introduction message now.";
|
||||
|
||||
// Create temporary chat history for intro generation
|
||||
const introHistory = [
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue