Skip to content

Conversation

@thorwebdev
Copy link

Updating models as per https://ai.google.dev/gemini-api/docs/deprecations

However for some reason the image models aren't working:

Error: AI: Error fetching from https://firebasevertexai.googleapis.com/v1beta/projects/fir-ai-test-e9308/models/gemini-2.5-flash-image:predict: [400 ] Request contains an invalid argument. (AI/fetch-error)

Any idea why?

@gemini-code-assist
Copy link

Summary of Changes

Hello @thorwebdev, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request updates the application's AI model configurations to align with recent deprecations and new model releases from Google's Gemini API. The changes primarily involve updating the lists of available generative, image, and live audio models to ensure the application uses the latest and supported versions, as per Google's official documentation.

Highlights

  • Generative Models Update: The list of available generative AI models has been updated to include newer gemini-3 preview models (gemini-3-flash-preview, gemini-3-pro-preview) and gemini-2.5-flash-lite, while deprecating older gemini-2.0 models and the original gemini-2.5-flash.
  • Image Models Update: The available image generation models have been updated to gemini-3-pro-image-preview and gemini-2.5-flash-image, replacing the imagen-4.0 series.
  • Live Audio Models Update: The LIVE_MODELS map has been updated for both GOOGLE_AI and VERTEX_AI backends, reflecting newer versions of the gemini-2.5-flash-native-audio models with updated preview dates and naming conventions.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the model names to align with recent deprecations. While the updates for generative and live models seem correct, the change to AVAILABLE_IMAGEN_MODELS introduces an issue. You've correctly identified that the image models are not working, and the reason is that the new model names (gemini-*-image-*) are for Gemini models, but they are being used with an API function (getImagenModel) intended for Imagen models. This mismatch is causing the 400 Invalid argument error. To fix this, you'll need to either find the correct replacement model names for the Imagen family or refactor the image generation logic to use the appropriate API for Gemini models, which is likely getGenerativeModel.

Comment on lines 25 to 28
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"
];

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant