refactor(sdk): migrate Providing_base_cases.ipynb to unified google-genai SDK#1082
refactor(sdk): migrate Providing_base_cases.ipynb to unified google-genai SDK#1082bhasinagam wants to merge 6 commits intogoogle-gemini:mainfrom
Conversation
…unified-sdk refactor(sdk): migrate Providing_base_cases.ipynb to unified google-genai SDK
…enai SDK ## Summary Migrates [examples/prompting/Providing_base_cases.ipynb](cci:7://file:///d:/GSoc@2026/cookbook/examples/prompting/Providing_base_cases.ipynb:0:0-0:0) from legacy `google-generativeai` to `google-genai` SDK. ## Changes - `%pip install 'google-genai>=1.0.0'` - `from google import genai` + `client = genai.Client()` - `client.models.generate_content()` pattern - Model selector with gemini-2.5/3.0 options - Imperative text style ## Testing - [x] Runs in Colab - [x] Formatted with nbfmt
…unified-sdk refactor(sdk): migrate Providing_base_cases.ipynb to unified google-g…
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
Summary of ChangesHello @bhasinagam, 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 refactors the Highlights
🧠 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 AssistThe 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
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 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
|
There was a problem hiding this comment.
Code Review
The pull request updates the Providing_base_cases.ipynb notebook to utilize the google-genai>=1.0.0 library, replacing the older google-generativeai package. This involves refactoring the API client initialization from genai.configure to genai.Client, introducing a configurable MODEL_ID variable, and modifying generate_content calls to explicitly pass model and system instruction configurations. The notebook's content was also refined with updated markdown descriptions and more detailed example outputs for model responses. A review comment noted that the execution_count values in the notebook were not null, indicating that the nbfmt formatting script had not been run, and requested that it be executed to reset these counts before merging.
…unified-sdk implemented nbfmt formatting
Summary
Migrates
examples/prompting/Providing_base_cases.ipynbfrom the legacygoogle-generativeaiSDK to the moderngoogle-genaiUnified SDK, withfull compliance to
.gemini/styleguide.md.Changes
SDK Migration
%pip install 'google-genai>=1.0.0'(with version per styleguide)from google import genai(correct import)client = genai.Client()patternclient.models.generate_content()with config dictStyleguide Compliance
gemini-2.5-flash,gemini-3-*-previewTesting
nbfmt