fix: update Gemini model names from deprecated -exp to current versions
gemini-2.0-flash-exp was removed from the API. Updated to: - gemini-2.5-flash for text generation - gemini-2.5-pro for outline/reasoning - gemini-2.5-flash-image for image generation with responseModalities Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
e644797001
commit
e3c4d74b1a
|
|
@ -281,8 +281,8 @@ export class FolkPrompt extends FolkShape {
|
|||
<div class="input-area">
|
||||
<select class="model-select">
|
||||
<optgroup label="Gemini">
|
||||
<option value="gemini-flash">Gemini Flash</option>
|
||||
<option value="gemini-pro">Gemini Pro</option>
|
||||
<option value="gemini-flash">Gemini 2.5 Flash</option>
|
||||
<option value="gemini-pro">Gemini 2.5 Pro</option>
|
||||
</optgroup>
|
||||
<optgroup label="Local (Ollama)">
|
||||
<option value="llama3.2">Llama 3.2 (3B)</option>
|
||||
|
|
|
|||
|
|
@ -780,8 +780,8 @@ app.post("/api/freecad/:action", async (c) => {
|
|||
|
||||
// ── Multi-provider prompt endpoint ──
|
||||
const GEMINI_MODELS: Record<string, string> = {
|
||||
"gemini-flash": "gemini-2.0-flash-exp",
|
||||
"gemini-pro": "gemini-1.5-pro",
|
||||
"gemini-flash": "gemini-2.5-flash",
|
||||
"gemini-pro": "gemini-2.5-pro",
|
||||
};
|
||||
const OLLAMA_MODELS: Record<string, string> = {
|
||||
"llama3.2": "llama3.2:3b",
|
||||
|
|
@ -872,7 +872,7 @@ app.post("/api/gemini/image", async (c) => {
|
|||
const { GoogleGenAI } = await import("@google/genai");
|
||||
const ai = new GoogleGenAI({ apiKey: GEMINI_API_KEY });
|
||||
|
||||
const models = ["gemini-2.0-flash-exp", "imagen-3.0-generate-002"];
|
||||
const models = ["gemini-2.5-flash-image", "imagen-3.0-generate-002"];
|
||||
for (const modelName of models) {
|
||||
try {
|
||||
if (modelName.startsWith("gemini")) {
|
||||
|
|
@ -949,7 +949,7 @@ app.post("/api/zine/outline", async (c) => {
|
|||
|
||||
const { GoogleGenerativeAI } = await import("@google/generative-ai");
|
||||
const genAI = new GoogleGenerativeAI(GEMINI_API_KEY);
|
||||
const model = genAI.getGenerativeModel({ model: "gemini-1.5-pro" });
|
||||
const model = genAI.getGenerativeModel({ model: "gemini-2.5-pro" });
|
||||
|
||||
const systemPrompt = `You are a zine designer creating a ${pageCount}-page MycroZine.
|
||||
Style: ${ZINE_STYLES[style] || style}
|
||||
|
|
@ -1027,7 +1027,7 @@ app.post("/api/zine/page", async (c) => {
|
|||
|
||||
try {
|
||||
const result = await ai.models.generateContent({
|
||||
model: "gemini-2.0-flash-exp",
|
||||
model: "gemini-2.5-flash-image",
|
||||
contents: enhancedPrompt,
|
||||
config: { responseModalities: ["Text", "Image"] },
|
||||
});
|
||||
|
|
@ -1073,7 +1073,7 @@ app.post("/api/zine/regenerate-section", async (c) => {
|
|||
|
||||
try {
|
||||
const result = await ai.models.generateContent({
|
||||
model: "gemini-2.0-flash-exp",
|
||||
model: "gemini-2.5-flash-image",
|
||||
contents: enhancedPrompt,
|
||||
config: { responseModalities: ["Text", "Image"] },
|
||||
});
|
||||
|
|
@ -1100,7 +1100,7 @@ app.post("/api/zine/regenerate-section", async (c) => {
|
|||
// Regenerate text via Gemini
|
||||
const { GoogleGenerativeAI } = await import("@google/generative-ai");
|
||||
const genAI = new GoogleGenerativeAI(GEMINI_API_KEY);
|
||||
const model = genAI.getGenerativeModel({ model: "gemini-2.0-flash-exp" });
|
||||
const model = genAI.getGenerativeModel({ model: "gemini-2.5-flash" });
|
||||
|
||||
const toneDesc = ZINE_TONES[tone] || tone;
|
||||
const prompt = `Rewrite this zine text section. Section type: "${section.id}". Page title: "${pageTitle}". Tone: ${toneDesc}.
|
||||
|
|
|
|||
Loading…
Reference in New Issue