| import { GoogleGenAI } from "@google/genai"; |
|
|
| const ai = new GoogleGenAI({ apiKey: process.env.GEMINI_API_KEY || "" }); |
|
|
| export async function getMetricExplanation(metric: string) { |
| const prompt = `Briefly explain the facial metric "${metric}" in the context of "looksmaxxing" culture, then explain why it's a pseudoscientific or unhealthy way to judge beauty. Keep it supportive and objective. Use 2 sentences max.`; |
| |
| try { |
| const result = await ai.models.generateContent({ |
| model: "gemini-3-flash-preview", |
| contents: prompt |
| }); |
| return result.text || "No explanation available."; |
| } catch (error) { |
| console.error("Gemini Error:", error); |
| return "Error fetching explanation."; |
| } |
| } |
|
|