Skip to content

Conversation

tpareek18
Copy link

Description

Introducing the following changes to the gemini/multimodal-live-api/websocket-demo-app:

  • Cleaner and more-organized UI for the Websocket Demo Application
  • Added functionality to allow for client-side configuration to enable proactive video in a session
  • Added functionality to allow for client-side control of audio and video sampling rate
  • Minor fixes for microphone and video toggle functionality

@tpareek18 tpareek18 requested a review from a team as a code owner August 21, 2025 00:07
Copy link
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.

Summary of Changes

Hello @tpareek18, 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 significantly enhances the websocket-demo-app by revamping its user interface for improved organization and clarity. It introduces a new proactive video feature, allowing users to enable video streaming to the AI model. Furthermore, it provides client-side controls for audio and video sampling rates, enabling fine-tuning of media capture. The changes also include crucial updates to API endpoints and an upgrade to the audio processing pipeline for better performance and reliability, alongside minor fixes to existing media toggle functionalities.

Highlights

  • Enhanced User Interface (UI) and Experience: The user interface of the websocket-demo-app has undergone a significant redesign, featuring a cleaner, more organized layout with new sections for connection, model behavior, and advanced settings. This improves usability and clarity for configuring the application.
  • Introduction of Proactive Video Feature: A new 'Proactive Video' feature has been integrated, allowing the client to configure the session to enable proactive video streams to the model. This is controlled via a new UI checkbox and corresponding API parameter.
  • Client-Side Control for Audio and Video Sampling Rates: Users can now configure the audio and video sampling rates directly from the client-side UI. This provides greater control over the frequency at which audio chunks and video frames are sent to the model, enabling optimization for different use cases or network conditions.
  • Improved Audio Processing with AudioWorklet: The underlying audio processing mechanism has been upgraded to use AudioWorkletNode and a new input-processor.js file. This modern approach to Web Audio API processing offers better performance and stability for real-time audio capture and conversion.
  • Expanded API Response Handling: The application now supports a wider range of API response types, including voice activity detection (VAD) signals, session resumption handles, input/output audio transcriptions, and explicit end-of-turn or interruption signals. This enriches the feedback provided by the multimodal AI.
  • API Endpoint Updates: The API endpoints have been updated to point to autopush environments and utilize internal.LlmBidiService, indicating a shift towards internal testing or a newer version of the API for multimodal interactions.
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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

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 issue 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
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 significantly overhauls the UI of the websocket demo application, making it much more organized and feature-rich. It also adds extensive new functionality, including proactive video, configurable sampling rates, and other advanced settings. My review focuses on improving code quality by removing dead code and development artifacts, fixing some bugs in the UI logic and HTML, and enhancing consistency and debuggability in the JavaScript code.

Comment on lines +72 to +95
<md-select-option selected value="puck">
<div slot="headline">puck</div>
</md-select-option>
<md-select-option selected value="charon">
<div slot="headline">charon</div>
</md-select-option>
<md-select-option selected value="kore">
<div slot="headline">kore</div>
</md-select-option>
<md-select-option selected value="fenrir">
<div slot="headline">fenrir</div>
</md-select-option>
<md-select-option selected value="aoede">
<div slot="headline">aoede</div>
</md-select-option>
<md-select-option selected value="orus">
<div slot="headline">orus</div>
</md-select-option>
<md-select-option selected value="zephyr">
<div slot="headline">zephyr</div>
</md-select-option>
<md-select-option selected value="leda">
<div slot="headline">leda</div>
</md-select-option>
Copy link
Contributor

Choose a reason for hiding this comment

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

high

Multiple <md-select-option> elements within this voiceName select component have the selected attribute. For a single-select dropdown, only one option can be the default. This will lead to unpredictable behavior where the browser selects the last option marked as selected. Please ensure only one option is marked as selected to define the intended default value. This issue is also present in other select elements like voiceLocale.

Comment on lines 9 to 12
# !!! Need to change this as well to make the environment switch work.
# HOST = "us-central1-staging-aiplatform.sandbox.googleapis.com"
# HOST = "us-central1-aiplatform.googleapis.com"
# SERVICE_URL = f"wss://{HOST}/ws/google.cloud.aiplatform.v1beta1.LlmBidiService/BidiGenerateContent"
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

These commented-out variables and the !!! comment suggest temporary development code. This should be cleaned up before merging. If you need to support multiple environments, consider using environment variables or a configuration file for better maintainability.

Comment on lines 60 to 61
// this.serviceUrl = `wss://${this.apiHost}/ws/google.cloud.aiplatform.v1beta1.LlmBidiService/BidiGenerateContent`;
this.serviceUrl = `wss://${this.apiHost}/ws/google.cloud.aiplatform.internal.LlmBidiService/BidiGenerateContent`;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Remove commented code or change this to v1beta1 if internal doesn't work externally.

These values can/should also be set in another way

Copy link
Author

Choose a reason for hiding this comment

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

Changed to v1beta1. Will look for a better way to set these values. Thank you!

Comment on lines +70 to +74
<div class="form-grid">
<md-outlined-select label="Voice Name" id="voiceName">
<md-select-option selected value="puck">
<div slot="headline">puck</div>
</md-select-option>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you load these in from the backend so you can loop instead of hardcoding them all here? Or be able to fetch this info from the API itself?

@holtskinner
Copy link
Collaborator

Assigning to @ZackAkil as he originally created this

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.

3 participants