-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Update Notebooks for Google Gen AI SDK #1601
base: main
Are you sure you want to change the base?
Conversation
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
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.
Hi @holtskinner, reviewers, and future viewers!
I'm Gemini, currently reviewing this pull request. In the meantime, I'm providing a summary for everyone to quickly grasp the changes and intent.
This pull request, titled feat: Update Notebooks for Google Gen AI SDK, aims to update the core feature notebooks to utilize the Google Gen AI SDK. Specifically, the changes include:
- Migration to Google Gen AI SDK: The notebooks are updated to use the
google-genai
library instead of the oldergoogle-cloud-aiplatform
library. This is reflected in the changes tointro_context_caching.ipynb
(lines 139, 150, 239-251, 279-287, 355-367, 389-393, 476, 493, 537-543, 567) andintro_controlled_generation.ipynb
(lines 143, 154, 243-255, 285-287, 365-372, 507-510, 538-568, 612-623, 674-695, 716-733). - Renamed Vertex AI SDK Notebooks: Notebooks originally using the Vertex AI SDK are renamed to include
_vertex_ai_sdk
in their filenames. A new fileintro_context_caching_vertex_ai_sdk.ipynb
has been added (lines 1-570) to contain the original Vertex AI SDK code. - Documentation Updates: The
intro_context_caching.ipynb
notebook includes a link to the official Google Gen AI SDK documentation (lines 109-110). Minor updates to text and code comments are also present throughout the notebooks. - Model ID Update: The model ID in
intro_context_caching.ipynb
is updated fromgemini-1.5-pro-001
togemini-1.5-pro-002
(lines 297-299, 309-311). Theintro_controlled_generation.ipynb
notebook does not have any model ID changes. - Code Refactoring: Several code sections are refactored to align with the new SDK, including changes to how context caches are created, retrieved, and used (lines 344-367, 415-455, 476, 537-543, 567).
I will continue my review shortly. In the meantime, please review the changes and let me know if you have any questions.
Small changes made,
Code now feels new,
A better design.
Gemini encountered an error creating the review. You can try again by commenting |
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.
Hi @holtskinner, I'm Gemini, and I'm currently reviewing your pull request. In the meantime, I'm providing a summary of the PR's content for you and other reviewers to quickly get up to speed.
This pull request, titled feat: Update Notebooks for Google Gen AI SDK, aims to update the core feature notebooks to utilize the Google Gen AI SDK. Specifically, the changes involve:
- Moving Vertex AI SDK Notebooks: The existing notebooks using the Vertex AI SDK have been moved to new files with the naming convention
original_filename_vertex_ai_sdk.ipynb
. - Updating
gemini/context-caching/intro_context_caching.ipynb
:- Added a link to the official context caching documentation (lines 108-112).
- Updated the installation instructions to use
google-genai
instead ofgoogle-cloud-aiplatform
(lines 135-150). - Replaced references to
vertexai
withgenai
throughout the notebook (multiple changes). - Updated the model ID to
gemini-1.5-pro-002
(lines 295-310). - Refactored code for creating, retrieving, and updating context caches to use the
genai
client (multiple changes). - Removed redundant code and improved clarity (multiple changes).
The changes are substantial and improve the notebooks by updating them to use the newer Google Gen AI SDK. The updated notebooks are more concise and easier to follow. I will provide a more detailed review shortly.
Meanwhile, here's a little poem to lighten the mood:
Code flows like a river,
Through branches, a winding path,
New SDK, clear stream.
Gemini encountered an error creating the review. You can try again by commenting |
0489407
to
c9aeac8
Compare
Description
Update core feature notebooks to Gen AI SDK
Move Vertex AI SDK Notebooks to new files
original_filename_vertex_ai_sdk.ipynb