Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 7 additions & 9 deletions ai/ai-react-app/src/services/firebaseAIService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,17 @@ import {
import { firebaseConfig } from "../config/firebase-config";

export const AVAILABLE_GENERATIVE_MODELS = [
"gemini-2.0-flash",
"gemini-2.0-flash-lite",
"gemini-2.0-flash-exp",
"gemini-2.5-flash"
"gemini-3-flash-preview",
"gemini-3-pro-preview",
"gemini-2.5-flash-lite",
];
export const AVAILABLE_IMAGEN_MODELS = [
"imagen-4.0-generate-001",
"imagen-4.0-fast-generate-001",
"imagen-4.0-ultra-generate-001"
"gemini-3-pro-image-preview",
"gemini-2.5-flash-image"
];
Comment on lines 25 to 28

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

These model names belong to the Gemini family, not Imagen. The ImagenView.tsx component uses getImagenModel, which is likely causing the 400 Invalid argument error you're encountering because it expects Imagen-specific model names.

To resolve this, you have two options:

  1. Find the new Imagen model names that are the correct replacements for the deprecated ones.
  2. If image generation is now meant to be done through Gemini models, you will need to refactor ImagenView.tsx to use getGenerativeModel instead of getImagenModel. The API call and response handling for image generation with Gemini models are different from Imagen.

export const LIVE_MODELS = new Map<BackendType, string>([
[BackendType.GOOGLE_AI, 'gemini-2.5-flash-native-audio-preview-09-2025'],
[BackendType.VERTEX_AI, 'gemini-live-2.5-flash-preview-native-audio-09-2025']
[BackendType.GOOGLE_AI, 'gemini-2.5-flash-native-audio-preview-12-2025'],
[BackendType.VERTEX_AI, 'gemini-live-2.5-flash-native-audio']
])

let app: FirebaseApp;
Expand Down