-
Notifications
You must be signed in to change notification settings - Fork 6.5k
feat(generativeai): Create genai_sdk_supervised_list_example.py #13352
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
base: main
Are you sure you want to change the base?
Conversation
Add a Gen AI SDK example to list tuning jobs.
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.
Hello @yishan-pu, 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!
Summary of Changes
This pull request adds a new example script, genai_sdk_supervised_list_example.py
, to demonstrate how to list tuning jobs using the Gen AI SDK. The script initializes a Gen AI client, then calls the tunings.list()
method to retrieve a list of tuning jobs, and prints the response for each job.
Highlights
- New Example Script: A new Python script,
genai_sdk_supervised_list_example.py
, has been added to showcase listing tuning jobs using the Gen AI SDK. - Listing Tuning Jobs: The script uses the
client.tunings.list()
method to retrieve and print a list of tuning jobs. - Environment Variable: The script uses the
GOOGLE_CLOUD_PROJECT
environment variable to determine the project ID.
Changelog
- generative_ai/model_tuning/genai_sdk_supervised_list_example.py
- Created a new file
generative_ai/model_tuning/genai_sdk_supervised_list_example.py
. - Added a function
genai_sdk_list_tuning_jobs
to list tuning jobs using the Gen AI SDK. - Included example usage of the
client.tunings.list()
method. - Added a
TODO
comment to remind developers to update thePROJECT_ID
if needed. - Added a main block to execute the
genai_sdk_list_tuning_jobs
function when the script is run.
- Created a new file
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 is currently in preview and 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 to provide feedback.
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.
A list of jobs, a simple call,
The SDK shows them, standing tall.
With project set,
The jobs we get,
For tuning models, one and all.
Footnotes
-
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. ↩
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
The code adds a new example for listing tuning jobs using the Gen AI SDK. The example is straightforward and easy to understand. However, there are a few areas that could be improved for clarity and completeness.
Summary of Findings
- Missing Project ID: The example code includes a
TODO
comment indicating that the project ID needs to be updated. This should be addressed to ensure the example works out of the box. - Lack of Error Handling: The code does not include any error handling. It would be beneficial to add error handling to make the example more robust.
Merge Readiness
The code is functional but needs some improvements before merging. The TODO
comment should be addressed, and error handling should be added. I am unable to approve this pull request, and recommend that others review and approve this code before merging.
Here is the summary of possible violations 😱 There is a possible violation for not having product prefix.
The end of the violation section. All the stuff below is FYI purposes only. Here is the summary of changes. You are about to add 1 region tag.
This comment is generated by snippet-bot.
|
Add a Gen AI SDK example to list tuning jobs.