Skip to content

Use new enterprise env variable for Gemini calls#14199

Open
jscud wants to merge 1 commit into
GoogleCloudPlatform:mainfrom
jscud:patch-1
Open

Use new enterprise env variable for Gemini calls#14199
jscud wants to merge 1 commit into
GoogleCloudPlatform:mainfrom
jscud:patch-1

Conversation

@jscud
Copy link
Copy Markdown

@jscud jscud commented May 20, 2026

Description

Fixes #14198

Note: Before submitting a pull request, please open an issue for discussion if you are not associated with Google.

Checklist

Changes GOOGLE_GENAI_USE_VERTEXAI to GOOGLE_GENAI_USE_ENTERPRISE

  • This sample adds a new sample directory, and I updated the CODEOWNERS file with the codeowners for this sample
  • This sample adds a new Product API, and I updated the Blunderbuss issue/PR auto-assigner with the codeowners for this sample
  • Please merge this PR for me once it is approved

@jscud jscud requested review from a team as code owners May 20, 2026 00:54
@product-auto-label product-auto-label Bot added the samples Issues that are directly related to samples. label May 20, 2026
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the environment variable key from GOOGLE_GENAI_USE_VERTEXAI to GOOGLE_GENAI_USE_ENTERPRISE in the test file. Feedback indicates that setting environment variables at the module level can cause side effects by modifying global state and suggests that the specific variable is unused in this context, recommending its removal or the use of a scoped fixture like monkeypatch for better test isolation.

import templatefolder_with_txt

os.environ["GOOGLE_GENAI_USE_VERTEXAI"] = "True"
os.environ["GOOGLE_GENAI_USE_ENTERPRISE"] = "True"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Setting environment variables at the module level in tests modifies global state and can cause side effects. Additionally, 'GOOGLE_GENAI_USE_ENTERPRISE' is not used by 'templatefolder_with_txt.py', making this dead code in this context. For a template, it is better to remove unnecessary boilerplate or use a scoped fixture (e.g., 'monkeypatch') to ensure test isolation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

samples Issues that are directly related to samples.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update VertexAI Environment Variable to use GOOGLE_GENAI_USE_ENTERPRISE instead

1 participant