Skip to content

chore: update deprecated models to gemini-1.5/2.5 family to Latest Mo…#1148

Open
kkorpal wants to merge 8 commits intomainfrom
update-deprecated-models
Open

chore: update deprecated models to gemini-1.5/2.5 family to Latest Mo…#1148
kkorpal wants to merge 8 commits intomainfrom
update-deprecated-models

Conversation

@kkorpal
Copy link
Copy Markdown
Collaborator

@kkorpal kkorpal commented Mar 4, 2026

Description

Updated several notebooks and scripts that were still referencing deprecated models (e.g., gemini-2.0-flash, gemini-2.5-flash) to the newer models (gemini-3-flash-preview, text-embedding-001, etc.).

All modified notebooks have been tested to ensure compatibility with the new model endpoints.

@kkorpal kkorpal requested review from Giom-V and patrickloeber March 4, 2026 08:17
@review-notebook-app
Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@github-actions github-actions bot added status:awaiting review PR awaiting review from a maintainer component:examples Issues/PR referencing examples folder component:quickstarts Issues/PR referencing quickstarts folder labels Mar 4, 2026
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, 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 focuses on maintaining the examples and quickstarts by updating them to use the most current and supported Gemini models. This ensures that users are always leveraging the latest capabilities and avoiding deprecated endpoints, which improves the overall reliability and future-proofing of the provided code.

Highlights

  • Model Updates: Updated references to deprecated Gemini models (e.g., gemini-2.0-flash, gemini-2.5-flash) across various notebooks and scripts.
  • New Model Adoption: Migrated to newer model families, primarily gemini-3-flash-preview and text-embedding-001, ensuring compatibility with the latest API endpoints.
  • Notebook Validation: All modified Jupyter notebooks were tested to confirm their functionality and compatibility with the updated model endpoints.
Changelog
  • examples/Anomaly_detection_with_embeddings.ipynb
    • Updated embedding model ID from 'text-embedding-004' to 'text-embedding-001'.
    • Adjusted output formatting for consistency.
  • examples/Browser_as_a_tool.ipynb
    • Updated the primary model to 'gemini-3-flash-preview'.
  • examples/Datasets.ipynb
    • Updated evaluation models from 'gemini-2.5-flash' and 'gemini-2.5-pro' to 'gemini-3-flash-preview' and 'gemini-3-pro-preview'.
  • examples/Pdf_structured_outputs_on_invoices_and_forms.ipynb
    • Updated the default model ID to 'gemini-3-flash-preview'.
  • examples/Search_Wikipedia_using_ReAct.ipynb
    • Updated the ReAct agent's model from 'gemini-2.0-flash' to 'gemini-3-flash-preview'.
  • examples/Voice_memos.ipynb
    • Updated the model ID for content generation to 'gemini-3-flash-preview'.
  • examples/fastrtc_ui.py
    • Updated the live API connection model from 'gemini-2.5-flash-lite' to 'gemini-3-flash-preview'.
  • examples/gemini_google_adk_model_guardrails.ipynb
    • Updated the LLM agent's model from 'gemini-2.5-flash' to 'gemini-3-flash-preview'.
  • examples/langchain/Chat_with_SQL_using_langchain.ipynb
    • Updated the ChatGoogleGenerativeAI model to 'gemini-3-flash-preview'.
    • Refactored markdown output to use an array of strings for better formatting.
  • examples/langchain/Gemini_LangChain_QA_Chroma_WebLoad.ipynb
    • Updated the ChatGoogleGenerativeAI model to 'gemini-3-flash-preview'.
  • examples/langchain/Gemini_LangChain_QA_Pinecone_WebLoad.ipynb
    • Updated the ChatGoogleGenerativeAI model to 'gemini-3-flash-preview'.
  • examples/langchain/Gemini_LangChain_Summarization_WebLoad.ipynb
    • Updated the ChatGoogleGenerativeAI model to 'gemini-3-flash-preview'.
  • examples/llamaindex/Gemini_LlamaIndex_QA_Chroma_WebPageReader.ipynb
    • Updated the GoogleGenAI model name to 'models/gemini-3-flash-preview'.
  • examples/prompting/Basic_Classification.ipynb
    • Updated the content generation model to 'gemini-3-flash-preview'.
    • Adjusted output formatting for consistency.
  • examples/prompting/Basic_Evaluation.ipynb
    • Updated the model ID for content generation to 'gemini-3-flash-preview'.
  • examples/prompting/Few_shot_prompting.ipynb
    • Updated the model ID for content generation to 'gemini-3-flash-preview'.
  • examples/prompting/Providing_base_cases.ipynb
    • Updated the GenerativeModel name to 'gemini-3-flash-preview'.
    • Adjusted output formatting for consistency.
  • examples/prompting/Role_prompting.ipynb
    • Updated the model ID for content generation to 'gemini-3-flash-preview'.
  • examples/prompting/Zero_shot_prompting.ipynb
    • Updated the model ID for content generation to 'gemini-3-flash-preview'.
  • examples/weaviate/personalized_description_with_weaviate_and_gemini_api.ipynb
    • Updated the embedding model from 'text-embedding-004' to 'text-embedding-001'.
  • examples/weaviate/query-agent-as-a-tool.ipynb
    • Updated the chat creation model from 'gemini-2.0-flash' to 'gemini-3-flash-preview'.
  • quickstarts-js/Audio.js
    • Updated the MODEL_ID constant to 'gemini-3-flash-preview'.
  • quickstarts-js/Counting_Tokens.js
    • Updated the MODEL_ID constant to 'gemini-3-flash-preview'.
  • quickstarts-js/File_API.js
    • Updated the MODEL_ID constant to 'gemini-3-flash-preview'.
  • quickstarts/Get_started_LiveAPI_tools.ipynb
    • Updated the MODEL_ID for LiveAPI tools to 'gemini-2.5-flash-native-audio-preview-12-2025'.
    • Adjusted numerous output cells to use array formatting for markdown text.
  • quickstarts/Models.ipynb
    • Updated the model name checked in the client list to 'models/gemini-3-flash-preview'.
  • quickstarts/rest/Caching_REST.ipynb
    • Updated the model specified in the bash command to 'models/gemini-3-flash-preview'.
  • quickstarts/websockets/LiveAPI_streaming_in_colab.ipynb
    • Updated the MODEL constant to 'models/gemini-2.5-flash-native-audio-preview-12-2025'.
Activity
  • The author, kkorpal, updated several notebooks and scripts to reference newer Gemini models, replacing deprecated versions.
  • All modified notebooks were tested to ensure compatibility with the new model endpoints.
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
Copy Markdown
Contributor

@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 several notebooks and scripts to use newer Gemini models, replacing deprecated ones. The changes are generally correct and align with the goal of keeping the examples up-to-date. My review focuses on ensuring consistency in the Colab notebooks, particularly where model selection is presented to the user. I've found several instances where @param model lists in comments are outdated or inconsistent with the newly set default model. Updating these will improve the user experience and maintainability of the notebooks, in line with the repository's style guide.

"\n",
"# Define the model you are going to use\n",
"model_id = \"gemini-2.5-flash\" # or \"gemini-2.5-flash-lite\", \"gemini-2.5-flash\", \"gemini-2.5-pro\", \"gemini-3.1-flash-lite-preview\", \"gemini-3.1-pro-preview\""
"model_id = \"gemini-3-flash-preview\" # or \"gemini-2.5-flash-lite\", \"gemini-2.5-flash\", \"gemini-2.5-pro\", \"gemini-3.1-flash-lite-preview\", \"gemini-3.1-pro-preview\""
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The comment listing alternative models is outdated and doesn't include the new default gemini-3-flash-preview. According to the repository style guide, it's recommended to use a Colab parameter selector for model selection to improve maintainability. Please consider converting this to a @param dropdown.

model_id = "gemini-3-flash-preview" # @param ["gemini-3-flash-preview", "gemini-3-pro-preview", "gemini-3.1-flash-lite-preview", "gemini-3.1-pro-preview"] {"allow-input":true, isTemplate: true}
References
  1. When selecting a model, it is recommended to use a Colab parameter selector (@param) to make it easier for users to switch between models and for maintainers to update them. The list of models should be kept consistent and up-to-date. (link)

"\"\"\"\n",
"\n",
"MODEL_ID=\"gemini-2.5-flash\" # @param [\"gemini-2.5-flash-lite\",\"gemini-2.5-flash\",\"gemini-2.5-pro\", \"gemini-3.1-flash-lite-preview\", \"gemini-3.1-pro-preview\"] {\"allow-input\":true, isTemplate: true}\n",
"MODEL_ID=\"gemini-3-flash-preview\" # @param [\"gemini-2.5-flash-lite\",\"gemini-2.5-flash\",\"gemini-2.5-pro\", \"gemini-3.1-flash-lite-preview\", \"gemini-3.1-pro-preview\"] {\"allow-input\":true, isTemplate: true}\n",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The default MODEL_ID has been updated to gemini-3-flash-preview, but this model is not in the @param list. The list also contains several deprecated models. To ensure the Colab UI works as expected and to align with the goal of this PR, please update the list of models.

MODEL_ID="gemini-3-flash-preview" # @param ["gemini-3-flash-preview", "gemini-3-pro-preview", "gemini-3.1-flash-lite-preview", "gemini-3.1-pro-preview"] {"allow-input":true, isTemplate: true}

References
  1. When selecting a model, it is recommended to use a Colab parameter selector (@param) to make it easier for users to switch between models and for maintainers to update them. The list of models should be kept consistent and up-to-date. (link)

"outputs": [],
"source": [
"MODEL_ID=\"gemini-2.5-flash\" # @param [\"gemini-2.5-flash-lite\",\"gemini-2.5-flash\",\"gemini-2.5-pro\",\"gemini-3.1-flash-lite-preview\",\"gemini-3.1-pro-preview\"] {\"allow-input\":true, isTemplate: true}"
"MODEL_ID=\"gemini-3-flash-preview\" # @param [\"gemini-2.5-flash-lite\",\"gemini-2.5-flash\",\"gemini-2.5-pro\",\"gemini-3.1-flash-lite-preview\",\"gemini-3.1-pro-preview\"] {\"allow-input\":true, isTemplate: true}"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The default MODEL_ID has been updated to gemini-3-flash-preview, but this model is not in the @param list. The list also contains several deprecated models. To ensure the Colab UI works as expected and to align with the goal of this PR, please update the list of models.

MODEL_ID="gemini-3-flash-preview" # @param ["gemini-3-flash-preview", "gemini-3-pro-preview", "gemini-3.1-flash-lite-preview", "gemini-3.1-pro-preview"] {"allow-input":true, isTemplate: true}
References
  1. When selecting a model, it is recommended to use a Colab parameter selector (@param) to make it easier for users to switch between models and for maintainers to update them. The list of models should be kept consistent and up-to-date. (link)

Copy link
Copy Markdown
Collaborator

@Giom-V Giom-V left a comment

Choose a reason for hiding this comment

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

A bit of nitpicking to keep things tidy

"text": [
"\u001b[?25l \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m0.0/137.7 kB\u001b[0m \u001b[31m?\u001b[0m eta \u001b[36m-:--:--\u001b[0m\r",
"\u001b[2K \u001b[91m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[91m╸\u001b[0m\u001b[90m━\u001b[0m \u001b[32m133.1/137.7 kB\u001b[0m \u001b[31m4.6 MB/s\u001b[0m eta \u001b[36m0:00:01\u001b[0m\r",
"\u001b[?25l \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m0.0/137.7 kB\u001b[0m \u001b[31m?\u001b[0m eta \u001b[36m-:--:--\u001b[0m\r\n",
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why are you adding \n in the output?

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

Labels

component:examples Issues/PR referencing examples folder component:quickstarts Issues/PR referencing quickstarts folder status:awaiting review PR awaiting review from a maintainer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants