Skip to content

WIP: Upgrade to Gemini 3.1 Flash Live#1177

Draft
thorwebdev wants to merge 2 commits intomainfrom
thor/gemini-3.1-flash-live-preview
Draft

WIP: Upgrade to Gemini 3.1 Flash Live#1177
thorwebdev wants to merge 2 commits intomainfrom
thor/gemini-3.1-flash-live-preview

Conversation

@thorwebdev
Copy link
Copy Markdown
Collaborator

@thorwebdev thorwebdev commented Mar 26, 2026

@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 26, 2026
@thorwebdev thorwebdev requested a review from Giom-V March 26, 2026 20:31
@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 primarily focuses on upgrading the codebase to utilize the 'gemini-3.1-flash-live-preview' model. This involved updating model references in various Python scripts and Jupyter notebooks, as well as adapting to changes in the Live API's input message structure and method calls. Additionally, some quickstart examples were simplified by removing deprecated or less relevant sections.

Highlights

  • Model Upgrade: The Gemini model reference has been upgraded to 'gemini-3.1-flash-live-preview' across all relevant examples and quickstarts.
  • API Adaptation: Code has been adapted to the new Live API input structure, replacing 'mediaChunks' with direct 'audio' or 'video' objects within 'realtimeInput' messages.
  • Method Renaming: API calls have been migrated from 'session.send_client_content' to 'session.send_realtime_input' where applicable.
  • WebSocket API Version Update: The WebSocket API endpoint version has been updated from 'v1beta' to 'v1alpha'.
  • Example Simplification: The 'Get_started_LiveAPI.ipynb' notebook has been streamlined by removing outdated sections on 'Text to Text' and 'Resumable Sessions', and a reference to a tool use tutorial.
  • Removed Example: The 'shell_websockets.sh' example script has been removed.
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.

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 multiple examples and quickstarts to use the gemini-3.1-flash-live-preview model and the latest Live API schema. Key changes include migrating from client_content and mediaChunks to the realtime_input structure (utilizing specific audio, video, or text fields), updating websocket URIs to the v1alpha version, and removing several sections from the notebooks, including text-to-text and resumable sessions. Feedback was provided regarding the removal of the 'Working with resumable sessions' section, noting that it might reduce the didactic value of the notebook and suggesting its re-inclusion or a reference to maintain alignment with the style guide's emphasis on educational clarity.

I am having trouble creating individual review comments. Click here to see my feedback.

quickstarts/Get_started_LiveAPI.ipynb (657-668)

medium

The removal of the 'Working with resumable sessions' section might reduce the didactic value of this notebook. If session resumption is still a relevant feature of the Live API, consider re-introducing this section with updated examples, or provide a clear reference to where users can find this information. This aligns with the style guide's emphasis on making notebooks easy to understand and limiting the need to consult external documentation.

Refer to Repository Style Guide, lines 11-14 and 92.

References
  1. Code should be easy to understand for all developers. Since they are notebooks and aimed at teaching how to use Gemini and its API/SDK, the focus should be on writting didactic and easy-to-read code while limiting the back and forth with the documentation or within the notebook. (link)
  2. Explain what you do, the features you use, and link to existing notebooks or to the documentation for more details. (link)

@thorwebdev thorwebdev force-pushed the thor/gemini-3.1-flash-live-preview branch from 37d43f2 to 11967d5 Compare March 27, 2026 04:59
@Giom-V Giom-V marked this pull request as draft March 31, 2026 07:20
@sanatan0511
Copy link
Copy Markdown

/assign

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