From ba5eef743e6ba6d4f14a6f0e8d0673c11a51330a Mon Sep 17 00:00:00 2001 From: Gemini AI Date: Mon, 29 Dec 2025 01:50:27 +0400 Subject: [PATCH] feat: add 'Same as source' option to slides count - Added 'Same as source' to translations in EN, RU, HE - Updated 'Number of Slides' dropdown to include 'Same as source' (value 0) - Updated Qwen, Ollama, and Z.AI services to handle 0 slide count by instructing AI to match source structure --- components/SlidesGenerator.tsx | 1 + lib/i18n/translations.ts | 3 +++ lib/services/ollama-cloud.ts | 2 +- lib/services/qwen-oauth.ts | 2 +- lib/services/zai-plan.ts | 2 +- 5 files changed, 7 insertions(+), 3 deletions(-) diff --git a/components/SlidesGenerator.tsx b/components/SlidesGenerator.tsx index 8c82609..a1f1da4 100644 --- a/components/SlidesGenerator.tsx +++ b/components/SlidesGenerator.tsx @@ -1140,6 +1140,7 @@ export default function SlidesGenerator() { onChange={(e) => setSlideCount(parseInt(e.target.value))} className="w-full rounded-md border border-input bg-background px-2.5 py-1.5 text-xs ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring" > + {[5, 8, 10, 12, 15, 20, 25, 30].map((n) => ( ))} diff --git a/lib/i18n/translations.ts b/lib/i18n/translations.ts index 3e2acbf..e7496d3 100644 --- a/lib/i18n/translations.ts +++ b/lib/i18n/translations.ts @@ -121,6 +121,7 @@ export const translations = { audience: "Target Audience", animations: "Animation Style", numSlides: "Number of Slides", + sameAsSource: "Same as source", generate: "Generate Presentation", generating: "Crafting your story...", emptyState: "Your presentation will appear here", @@ -281,6 +282,7 @@ export const translations = { audience: "Целевая аудитория", animations: "Стиль анимации", numSlides: "Количество слайдов", + sameAsSource: "Как в источнике", generate: "Создать презентацию", generating: "Создаем вашу историю...", emptyState: "Ваша презентация появится здесь", @@ -441,6 +443,7 @@ export const translations = { audience: "קהל יעד", animations: "סגנון אנימציה", numSlides: "מספר שקופיות", + sameAsSource: "כמו במקור", generate: "חולל מצגת", generating: "יוצר את הסיפור שלך...", emptyState: "המצגת שלך תופיע כאן", diff --git a/lib/services/ollama-cloud.ts b/lib/services/ollama-cloud.ts index a18f079..a5e927f 100644 --- a/lib/services/ollama-cloud.ts +++ b/lib/services/ollama-cloud.ts @@ -405,7 +405,7 @@ AUDIENCE STYLE: ${audienceStyle} ${organization ? `ORGANIZATION BRANDING: ${organization}` : ""} REQUIREMENTS: -- Create EXACTLY ${slideCount} slides +- ${slideCount > 0 ? `Create EXACTLY ${slideCount} slides` : "Maintain the exact number of slides/pages from the provided source presentation/document context. If no source file is provided, generate 10 slides by default."} - ALL content in ${language} - Each slide MUST have complete htmlContent with inline