From 1668609746164c75f6b2a99709003e3606548e60 Mon Sep 17 00:00:00 2001 From: Ivan Rudik Date: Sun, 9 Nov 2025 12:34:18 +0000 Subject: [PATCH] slight change in the geminiHelper to account for vercel --- app/utils/geminiHelper.ts | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/app/utils/geminiHelper.ts b/app/utils/geminiHelper.ts index c044ad6..aead2cf 100644 --- a/app/utils/geminiHelper.ts +++ b/app/utils/geminiHelper.ts @@ -9,18 +9,26 @@ if (!apiKey) { const genAI = new GoogleGenerativeAI(apiKey); +const DEFAULT_CHAT_SETTINGS: ChatSetting = { + model: "gemini-2.5-flash-lite", + systemInstructions: "you are going to create a project idea, explain it in summary first before going to detail", + temperature: 1 +}; + export async function chatToGemini( userMessage:string , history:ChatHistory, settings:ChatSetting ):Promise{ + const effectiveSettings = { ...DEFAULT_CHAT_SETTINGS, ...settings }; + const model = genAI.getGenerativeModel({ - model:settings.model || "gemini-2.5-flash-lite", - systemInstruction: settings.systemInstructions || "you are going to create a project idea, explain it in summary first before going to detail", + model: effectiveSettings.model, + systemInstruction: effectiveSettings.systemInstructions, }); const generationConfig:GenerateConfig = { - temperature : settings.temperature || 1, + temperature : effectiveSettings.temperature, topP : 0.9, responseMimeType: "text/plain", maxOutputTokens: 1900, // Increased to allow for longer responses