Skip to content

Commit 4f8fcc8

Browse files
author
Miriad
committed
feat: make Gemini model configurable via GEMINI_MODEL env var
Defaults to gemini-2.5-flash. Set GEMINI_MODEL env var to change without redeploying code.
1 parent 80c41da commit 4f8fcc8

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

lib/gemini.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export async function generateWithGemini(
1313
systemInstruction?: string,
1414
): Promise<string> {
1515
const model = genAI.getGenerativeModel({
16-
model: "gemini-2.5-flash",
16+
model: process.env.GEMINI_MODEL || "gemini-2.5-flash",
1717
...(systemInstruction && { systemInstruction }),
1818
});
1919
const result = await model.generateContent(prompt);

lib/sponsor/gemini-intent.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export async function extractSponsorIntent(message: string): Promise<SponsorInte
3434
}
3535

3636
const genAI = new GoogleGenerativeAI(apiKey)
37-
const model = genAI.getGenerativeModel({ model: 'gemini-2.5-flash' })
37+
const model = genAI.getGenerativeModel({ model: process.env.GEMINI_MODEL || 'gemini-2.5-flash' })
3838

3939
const prompt = `You are analyzing an inbound sponsorship inquiry for CodingCat.dev, a developer education platform with YouTube videos, podcasts, blog posts, and newsletters.
4040

lib/sponsor/gemini-outreach.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export async function generateOutreachEmail(
4242
}
4343

4444
const genAI = new GoogleGenerativeAI(apiKey)
45-
const model = genAI.getGenerativeModel({ model: 'gemini-2.5-flash' })
45+
const model = genAI.getGenerativeModel({ model: process.env.GEMINI_MODEL || 'gemini-2.5-flash' })
4646

4747
const optOutUrl = sponsor.optOutToken
4848
? `${process.env.NEXT_PUBLIC_URL || 'https://codingcat.dev'}/api/sponsor/opt-out?token=${sponsor.optOutToken}`

0 commit comments

Comments
 (0)