-
Notifications
You must be signed in to change notification settings - Fork 6.7k
feat(genai): migrate Vertex AI env var to Enterprise 02 #14229
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?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -25,7 +25,7 @@ | |
| import counttoken_with_txt | ||
| import counttoken_with_txt_vid | ||
|
|
||
| os.environ["GOOGLE_GENAI_USE_VERTEXAI"] = "True" | ||
| os.environ["GOOGLE_GENAI_USE_ENTERPRISE"] = "True" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Setting environment variables at the module level, especially after imports, can lead to issues if any imported modules initialize clients at the module level. It also causes global state mutation that can affect other tests in the suite. Consider using a pytest fixture with monkeypatch for better isolation. Additionally, note that Vertex AI (Enterprise) typically requires a regional location (e.g., us-central1) rather than global; you may need to update GOOGLE_CLOUD_LOCATION to ensure compatibility. |
||
| os.environ["GOOGLE_CLOUD_LOCATION"] = "global" # "us-central1" | ||
| # The project name is included in the CICD pipeline | ||
| # os.environ['GOOGLE_CLOUD_PROJECT'] = "add-your-project-name" | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,7 +21,7 @@ | |
| import safety_with_txt | ||
|
|
||
|
|
||
| os.environ["GOOGLE_GENAI_USE_VERTEXAI"] = "True" | ||
| os.environ["GOOGLE_GENAI_USE_ENTERPRISE"] = "True" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Setting environment variables at the module level, especially after imports, can lead to issues if any imported modules initialize clients at the module level. It also causes global state mutation that can affect other tests in the suite. Consider using a pytest fixture with monkeypatch for better isolation. Additionally, note that Vertex AI (Enterprise) typically requires a regional location (e.g., us-central1) rather than global; you may need to update GOOGLE_CLOUD_LOCATION to ensure compatibility. |
||
| os.environ["GOOGLE_CLOUD_LOCATION"] = "global" # "us-central1" | ||
| # The project name is included in the CICD pipeline | ||
| # os.environ['GOOGLE_CLOUD_PROJECT'] = "add-your-project-name" | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -39,7 +39,7 @@ | |
| import textgen_with_youtube_video | ||
| import thinking_textgen_with_txt | ||
|
|
||
| os.environ["GOOGLE_GENAI_USE_VERTEXAI"] = "True" | ||
| os.environ["GOOGLE_GENAI_USE_ENTERPRISE"] = "True" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Setting environment variables at the module level, especially after imports, can lead to issues if any imported modules initialize clients at the module level. It also causes global state mutation that can affect other tests in the suite. Consider using a pytest fixture with monkeypatch for better isolation. Additionally, note that Vertex AI (Enterprise) typically requires a regional location (e.g., us-central1) rather than global; you may need to update GOOGLE_CLOUD_LOCATION to ensure compatibility. |
||
| os.environ["GOOGLE_CLOUD_LOCATION"] = "global" # "us-central1" | ||
| # The project name is included in the CICD pipeline | ||
| # os.environ['GOOGLE_CLOUD_PROJECT'] = "add-your-project-name" | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,7 +17,7 @@ | |
| import thinking_includethoughts_with_txt | ||
| import thinking_with_txt | ||
|
|
||
| os.environ["GOOGLE_GENAI_USE_VERTEXAI"] = "True" | ||
| os.environ["GOOGLE_GENAI_USE_ENTERPRISE"] = "True" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Setting environment variables at the module level, especially after imports, can lead to issues if any imported modules initialize clients at the module level. It also causes global state mutation that can affect other tests in the suite. Consider using a pytest fixture with monkeypatch for better isolation. Additionally, note that Vertex AI (Enterprise) typically requires a regional location (e.g., us-central1) rather than global; you may need to update GOOGLE_CLOUD_LOCATION to ensure compatibility. |
||
| os.environ["GOOGLE_CLOUD_LOCATION"] = "global" # "us-central1" | ||
| # The project name is included in the CICD pipeline | ||
| # os.environ['GOOGLE_CLOUD_PROJECT'] = "add-your-project-name" | ||
|
|
||
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.
Setting environment variables at the module level, especially after imports, can lead to issues if any imported modules initialize clients at the module level. It also causes global state mutation that can affect other tests in the suite. Consider using a pytest fixture with monkeypatch for better isolation. Additionally, note that Vertex AI (Enterprise) typically requires a regional location (e.g., us-central1) rather than global; you may need to update GOOGLE_CLOUD_LOCATION to ensure compatibility.