`GOOGLE_API_KEY` -> `GEMINI_API_KEY`
Colab now uses GEMINI_API_KEY for keys imported from AI Studio, along with the default across the docs on ai.google.dev.
This brings the cookbook in line with the same defaults so users don't need to figure out they have to rename the key.
Check out this pull request on ![]()
See visual diffs & provide feedback on Jupyter Notebooks.
Powered by ReviewNB
Summary of Changes
Hello @markmcd, I'm Gemini Code Assist[^1]! 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 standardizes the API key variable name used in a wide array of Colab notebooks from GOOGLE_API_KEY to GEMINI_API_KEY. This update ensures that the examples are consistent with current best practices and official documentation, making it easier for users to get started without encountering naming discrepancies.
Highlights
- API Key Renaming: The primary change involves updating all instances of
GOOGLE_API_KEYtoGEMINI_API_KEYacross numerous Colab notebooks. - Documentation Alignment: This change aligns the API key naming convention with the latest standards used in AI Studio and
ai.google.devdocumentation, ensuring consistency. - Improved User Experience: Users will no longer need to manually rename their API keys when importing from AI Studio, simplifying the setup process for these notebooks.
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 by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.
| 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 pull request 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 :thumbsup: and :thumbsdown: 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.
[^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.
[!WARNING] Gemini encountered an error creating the review. You can try again by commenting
/gemini review.
I'm all for it, but what about those who manually copied their API key under the name "GOOGLE_API_KEY"?
I think we should add a "breaking change" on the main readme (and maybe remove the migration guide now that it's been nearly a year). Also I think CONTRIBUTING.md and .gemini/styleguide.md should also be updated accordingly. And maybe the authentication notebook should also be updated with explanations about the auto-import feature.