Add gemini-3.1-flash-image-preview (Nano Banana 2) support#137
Conversation
…ions Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
📝 WalkthroughWalkthroughSupport for a new Gemini image generation model "gemini-3.1-flash-image-preview" is added across the UI settings component, backend type definitions, and view display logic to recognize and handle the new model variant. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/components/settings/ImageGenSettings.vue (1)
122-125: Prefer deriving Gemini model type fromImageGenerationConfigValueto avoid drift.This cast duplicates literal unions already defined in backend types. Reusing the source type will reduce future miss-sync risk.
♻️ Suggested refactor
const handleGeminiModelChange = (event: Event) => { - const geminiModel = (event.target as HTMLSelectElement).value as - | "gemini-2.5-flash-image" - | "gemini-3.1-flash-image-preview" - | "gemini-3-pro-image-preview"; + const geminiModel = (event.target as HTMLSelectElement) + .value as NonNullable<ImageGenerationConfigValue["geminiModel"]>; emit("update:modelValue", { ...normalizedConfig.value, geminiModel, }); };🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/components/settings/ImageGenSettings.vue` around lines 122 - 125, Replace the hard-coded literal union cast on the geminiModel assignment with the backend-derived type: import the ImageGenerationConfigValue type and cast (or narrow) the event target value to the appropriate member/union from ImageGenerationConfigValue (e.g., the model field or an Extract<> of ImageGenerationConfigValue) instead of the inline `"gemini-..."` union; update the line that sets geminiModel in ImageGenSettings.vue to use ImageGenerationConfigValue so the component stays in sync with backend types.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@src/components/settings/ImageGenSettings.vue`:
- Around line 122-125: Replace the hard-coded literal union cast on the
geminiModel assignment with the backend-derived type: import the
ImageGenerationConfigValue type and cast (or narrow) the event target value to
the appropriate member/union from ImageGenerationConfigValue (e.g., the model
field or an Extract<> of ImageGenerationConfigValue) instead of the inline
`"gemini-..."` union; update the line that sets geminiModel in
ImageGenSettings.vue to use ImageGenerationConfigValue so the component stays in
sync with backend types.
ℹ️ Review info
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
src/components/settings/ImageGenSettings.vuesrc/tools/backend/types.tssrc/views/HomeView.vue
概要
画像生成モデル
gemini-3.1-flash-image-preview(Nano Banana 2)のサポートを追加。src/tools/backend/types.ts- union 型に追加src/components/settings/ImageGenSettings.vue- UI の選択肢・型に追加src/views/HomeView.vue- 表示名の条件分岐に追加参考
GitHub 検索結果
https://github.com/search?q=org%3Areceptron+gemini-3-pro-image-preview+OR+org%3Areceptron+gemini-2.5-flash-image++repo%3Areceptron%2FMulmoChat&type=code
Summary by CodeRabbit