- Notifications
You must be signed in to change notification settings - Fork1.8k
feat(genai): Add samples for live generation#5412
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
feat(genai): Add samples for live generation#5412
Uh oh!
There was an error while loading.Please reload this page.
Conversation
snippet-botbot commentedNov 15, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Here is the summary of changes. You are about to add 4 region tags.
This comment is generated bysnippet-bot.
|
Summary of ChangesHello@cfloress, 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 introduces a suite of new samples demonstrating the 'live generation' features of the GenAI SDK, enabling real-time interactions with Gemini models for tasks such as audio synthesis, code execution, and audio transcription. Simultaneously, it refactors existing code to enhance consistency by standardizing the use of a predefined constant for the user role, contributing to a more robust and maintainable codebase. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on ourdocumentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
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 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 uphere. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with theGemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this 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 introduces new samples for live generation with the GenAI SDK and refactors the use of role strings to constants, which is a great improvement for code quality.
I've reviewed the changes and have the following feedback:
- The new samples are well-written, but I found a few areas for improvement, including some leftover development code (commented-out code, debug prints), a hardcoded output file path, and one case of incomplete response handling that could lead to missing the model's final answer.
- The refactoring from
"user"togenai.RoleUseris applied consistently. However, I noticed one instance where this constant is used for a system instruction, which is likely incorrect. - The refactoring seems incomplete as other role strings like
"system"and"model"are still used as magic strings in the codebase. It would be great to replace them with constants as well for consistency.
I've left specific comments with suggestions on the relevant lines of code. Overall, this is a valuable addition to the samples.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Guiners left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
LGTM
66ccff1 intoGoogleCloudPlatform:mainUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Description
Fixes #
Note: Before submitting a pull request, please open an issue for discussion if you are not associated with Google.
Checklist
go test -v ./..(seeTesting)gofmt(seeFormatting)go vet(seeFormatting)