From 9b10b628af3d6ce37449ecdfb7c65ef0600bc149 Mon Sep 17 00:00:00 2001 From: "christian.vidal" Date: Fri, 27 Mar 2026 14:15:51 +0100 Subject: [PATCH] fix(translate): increase token limit and improve prompt for full translation (no summarizing) --- src/components/EditPanel.tsx | 10 +++++++++- src/services/gemini.ts | 4 ++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/components/EditPanel.tsx b/src/components/EditPanel.tsx index dd2f114..4f3b4b2 100644 --- a/src/components/EditPanel.tsx +++ b/src/components/EditPanel.tsx @@ -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}`; } diff --git a/src/services/gemini.ts b/src/services/gemini.ts index f947e21..f5fe0f3 100644 --- a/src/services/gemini.ts +++ b/src/services/gemini.ts @@ -39,8 +39,8 @@ export async function generateGemini(prompt: string, systemPrompt: string): Prom }] }], generationConfig: { - maxOutputTokens: 1000, - temperature: 0.7 + maxOutputTokens: 2048, + temperature: 0.2 } }) });