fix(translate): increase token limit and improve prompt for full translation (no summarizing)

This commit is contained in:
christian.vidal
2026-03-27 14:15:51 +01:00
parent 021bf96f32
commit 9b10b628af
2 changed files with 11 additions and 3 deletions
+9 -1
View File
@@ -46,7 +46,15 @@ export function EditPanel({ row, rowIndex, onSave, onClose }: EditPanelProps) {
prompt = `Based on the following product details, generate a long commercial description in German. It should be fluent, oriented towards B2B toy buyers, 3-5 paragraphs long. Include features, benefits, and material if available.\n\n${baseContext}`;
} else if (field === 'longEn') {
if (formData.longDe) {
prompt = `Translate exactly this German product description into professional English for the toy market. Ensure a natural flow and high-quality vocabulary:\n\n${formData.longDe}`;
prompt = `Translate the EVERYTHING below from German into professional English.
CRITICAL INSTRUCTIONS:
1. Do NOT summarize.
2. Maintain the EXACT same length and detailed information.
3. Keep all technical specs intact.
4. Translate every single paragraph.
German Text to Translate:
${formData.longDe}`;
} else {
prompt = `Based on the following product details, generate a long commercial description in English. It should be fluent, oriented towards B2B toy buyers, 3-5 paragraphs long.\n\n${baseContext}`;
}
+2 -2
View File
@@ -39,8 +39,8 @@ export async function generateGemini(prompt: string, systemPrompt: string): Prom
}]
}],
generationConfig: {
maxOutputTokens: 1000,
temperature: 0.7
maxOutputTokens: 2048,
temperature: 0.2
}
})
});