Repository navigation
feat(core): Add GOOGLE_GENAI_API_VERSION environment variable support - #16177
Conversation
Summary of ChangesHello @deyim, 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 enhances the core functionality by enabling users to explicitly control the Google GenAI API version through a new environment variable, Highlights
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
This pull request introduces support for the GOOGLE_GENAI_API_VERSION environment variable, allowing users to override the default API version. The changes include updates to the documentation, new unit tests, and the core implementation. The implementation is mostly correct, but I've found an edge case where an empty string for the environment variable is not handled as intended, which could lead to failed API requests. I've provided a suggestion to fix this. The added tests are good, but it would be beneficial to also cover this edge case.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
f94ee5f to
2a9ca55
Compare
|
This pull request is being closed because it is labeled as "🔒 maintainer only". Issues or pull requests with this label are restricted to project maintainers due to the sensitive or complex nature of the task. We value your desire to contribute! Please consider helping us resolve other open issues, specifically those marked with the help wanted label. |
|
I've reviewed and will approve. Can you resolve the merge conflicts in |
Hey @bdmorgan, thanks for taking a look at it. I've updated the |
7e50328 to
ffec5fe
Compare
|
@deyim thanks again for the pull request! there was one minor build error occurring that I hopefully fixed. If you test the main branch after this PR is in and see any issues, ping this PR and I can reopen. Thanks again!! |
…google-gemini#16177) Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Co-authored-by: Bryan Morgan <[email protected]>
…google-gemini#16177) Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Co-authored-by: Bryan Morgan <[email protected]>
|
This change is not compatible with |
…#16177) Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Co-authored-by: Bryan Morgan <[email protected]>
…google-gemini#16177) Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Co-authored-by: Bryan Morgan <[email protected]>
Summary
GOOGLE_GENAI_API_VERSIONenvironment variable to allow enterprise users with internal API proxies to override the default API version (v1beta1) used by the SDKDetails
GOOGLE_GENAI_API_VERSIONenv var and pass it to the GoogleGenAI constructor when setRelated Issues
How to Validate
npm run testand verify the 3 new tests incontentGenerator.test.tspass:should pass apiVersion to GoogleGenAI when GOOGLE_GENAI_API_VERSION is setshould not include apiVersion when GOOGLE_GENAI_API_VERSION is not setshould pass apiVersion for Vertex AI when GOOGLE_GENAI_API_VERSION is setVerify requests use
/v1/in the API path instead of/v1beta1/unset GOOGLE_GENAI_API_VERSION geminiVerify the SDK uses its default API version (v1beta1)
Verify it behaves the same as unset (uses SDK default)
Pre-Merge Checklist