From e35977cd39e7092f0ebf13b7273c2678597a512e Mon Sep 17 00:00:00 2001 From: Matthew Reichhoff Date: Sat, 16 May 2026 20:41:20 -0400 Subject: [PATCH 1/3] Actually upgrade gemini Turns out .prompt takes precedence, whoops. We stay on 2.5 for analyze image for costs / some odd errors with 3 --- functions/prompts/analyze-collocation.prompt | 2 +- functions/prompts/analyze-image.prompt | 6 ++++-- functions/prompts/explain-chinese.prompt | 2 +- functions/prompts/explain-english.prompt | 2 +- functions/prompts/explain-word-in-context.prompt | 2 +- functions/prompts/generate-chinese-sentences.prompt | 2 +- 6 files changed, 9 insertions(+), 7 deletions(-) diff --git a/functions/prompts/analyze-collocation.prompt b/functions/prompts/analyze-collocation.prompt index a101ca0e..190821ef 100644 --- a/functions/prompts/analyze-collocation.prompt +++ b/functions/prompts/analyze-collocation.prompt @@ -1,5 +1,5 @@ --- -model: vertexai/gemini-2.0-flash-001 +model: vertexai/gemini-3-flash-preview input: schema: collocation: string diff --git a/functions/prompts/analyze-image.prompt b/functions/prompts/analyze-image.prompt index c2933bd0..e229dd9e 100644 --- a/functions/prompts/analyze-image.prompt +++ b/functions/prompts/analyze-image.prompt @@ -1,10 +1,12 @@ --- -model: vertexai/gemini-2.0-flash-001 +model: vertexai/gemini-2.5-flash +config: + maxOutputTokens: 65536 input: schema: base64ImageUrl: string output: schema: ImageAnalysisSchema --- -Read the Chinese text in this image: {{media url=base64ImageUrl}}, split it into sentences, and then explain it, including an English translation for each sentence and any relevant grammar rules. +Read the Chinese text in this image: {{media url=base64ImageUrl}}. Split the complete text into every individual sentence, providing pinyin and an English translation for each one. Then provide an overall plain-text explanation of the passage and any relevant grammar rules. If the image contains good English translations of the Chinese text, use those verbatim. diff --git a/functions/prompts/explain-chinese.prompt b/functions/prompts/explain-chinese.prompt index 36ba166b..745ea71b 100644 --- a/functions/prompts/explain-chinese.prompt +++ b/functions/prompts/explain-chinese.prompt @@ -1,5 +1,5 @@ --- -model: vertexai/gemini-2.0-flash-001 +model: vertexai/gemini-3-flash-preview input: schema: text: string diff --git a/functions/prompts/explain-english.prompt b/functions/prompts/explain-english.prompt index f92836bf..0a04b1a8 100644 --- a/functions/prompts/explain-english.prompt +++ b/functions/prompts/explain-english.prompt @@ -1,5 +1,5 @@ --- -model: vertexai/gemini-2.0-flash-001 +model: vertexai/gemini-3-flash-preview input: schema: text: string diff --git a/functions/prompts/explain-word-in-context.prompt b/functions/prompts/explain-word-in-context.prompt index 4f2996a8..0b576e07 100644 --- a/functions/prompts/explain-word-in-context.prompt +++ b/functions/prompts/explain-word-in-context.prompt @@ -1,5 +1,5 @@ --- -model: vertexai/gemini-2.0-flash-001 +model: vertexai/gemini-3-flash-preview input: schema: ExplainWordInContextInputSchema output: diff --git a/functions/prompts/generate-chinese-sentences.prompt b/functions/prompts/generate-chinese-sentences.prompt index eab9b692..48ebbbd5 100644 --- a/functions/prompts/generate-chinese-sentences.prompt +++ b/functions/prompts/generate-chinese-sentences.prompt @@ -1,5 +1,5 @@ --- -model: vertexai/gemini-2.0-flash-001 +model: vertexai/gemini-3-flash-preview input: schema: GenerateChineseSentencesInputSchema output: From 8419d13a5f987f5515807aac1e0191f7af09f653 Mon Sep 17 00:00:00 2001 From: Matthew Reichhoff Date: Sat, 16 May 2026 21:16:05 -0400 Subject: [PATCH 2/3] Upgrade evaluator model --- functions/src/genkit-eval.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions/src/genkit-eval.ts b/functions/src/genkit-eval.ts index 80a2f912..c8be9761 100644 --- a/functions/src/genkit-eval.ts +++ b/functions/src/genkit-eval.ts @@ -179,7 +179,7 @@ export const grammarExplanationQualityEvaluator = ai.defineEvaluator( JSON.stringify(datapoint.output); const { output: evalResult } = await ai.generate({ - model: vertexAI.model('gemini-3-pro-preview'), + model: vertexAI.model('gemini-3.1-pro-preview'), prompt: `You are evaluating a Chinese language learning tool's output quality. Input (Chinese text to explain): ${input} From a77a34ac69588b13f4cd02a21e23b44a9c600b05 Mon Sep 17 00:00:00 2001 From: Matthew Reichhoff Date: Sat, 16 May 2026 21:47:25 -0400 Subject: [PATCH 3/3] why is autoeval model name in two spots? --- functions/src/genkit-eval.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions/src/genkit-eval.ts b/functions/src/genkit-eval.ts index c8be9761..d9f894d7 100644 --- a/functions/src/genkit-eval.ts +++ b/functions/src/genkit-eval.ts @@ -248,7 +248,7 @@ export const sentenceGenerationQualityEvaluator = ai.defineEvaluator( JSON.stringify(datapoint.output); const { output: evalResult } = await ai.generate({ - model: vertexAI.model('gemini-3-pro-preview'), + model: vertexAI.model('gemini-3.1-pro-preview'), prompt: `You are evaluating generated Chinese example sentences for a language learning app. Input (word and definitions): ${input}