google / google/adk-python

Keep GOOGLE_GENAI_USE_VERTEXAI as a long-term alias without runtime deprecation warnings

オープン
#6,168 コメント 1 件 リアクション 0 件 担当者 2 名 @DeanChensj が担当を希望しています GitHub で見る
core needs review
主要言語
Python
スター
21.5k
フォーク
4k
平均マージ
1日 14時間
マージ済み PR(30日)
37

説明

** Please make sure you read the contribution guide and file the issues in the right place. **
[Contribution guide.](https://google.github.io/adk-docs/contributing-guide/)

## 🔴 Required Information
*Please ensure all items in this section are completed to allow for efficient
triaging. Requests without complete information may be rejected / deprioritized.
If an item is not applicable to you - please mark it as N/A*

### Is your feature request related to a specific problem?

After commit 4e85e9c, ADK introduced `GOOGLE_GENAI_USE_ENTERPRISE` and treats `GOOGLE_GENAI_USE_VERTEXAI` as a **deprecated** fallback. When `GOOGLE_GENAI_USE_VERTEXAI` is set, ADK emits a `DeprecationWarning`:

```text
GOOGLE_GENAI_USE_VERTEXAI is deprecated, please use GOOGLE_GENAI_USE_ENTERPRISE instead
```

I understand the motivation for introducing the new name, but from an ADK user perspective `GOOGLE_GENAI_USE_VERTEXAI` is a public configuration surface that clearly describes the backend selection: use Vertex AI instead of the Gemini Developer API.

This environment variable can be spread across `.env` files, CI workflows, Dockerfiles, Kubernetes manifests, deployment scripts, samples, and internal documentation. Requiring users to rename it creates migration work without changing application behavior.

The runtime warning also creates noise and can become disruptive in environments that treat warnings strictly.

### Describe the Solution You'd Like

Please keep `GOOGLE_GENAI_USE_VERTEXAI` as a long-term supported alias for `GOOGLE_GENAI_USE_ENTERPRISE`, and stop emitting a runtime `DeprecationWarning` for it.

A possible behavior would be:

- `GOOGLE_GENAI_USE_ENTERPRISE` remains the preferred variable in new documentation.
- `GOOGLE_GENAI_USE_VERTEXAI` remains supported as a compatibility alias.
- If both variables are set, `GOOGLE_GENAI_USE_ENTERPRISE` takes precedence.
- Using `GOOGLE_GENAI_USE_VERTEXAI` does **not emit a runtime deprecation warning** unless there is a clearly announced removal plan tied to a major version.

### Impact on your work

This avoids unnecessary churn in existing ADK deployments and documentation.

Many projects already use `GOOGLE_GENAI_USE_VERTEXAI=true` as a stable way to select the Vertex AI backend. Renaming that variable across CI/CD, deployment configuration, examples, and local developer environments takes time but does not provide a direct functional benefit to users.

Keeping the old variable as a quiet long-term alias would preserve backward compatibility while still allowing ADK to document the newer name going forward.

### Willingness to contribute

Yes, I can help validate the behavior. If maintainers agree with this direction, I may also be able to send a small PR.

---

## 🟡 Recommended Information

### Describe Alternatives You've Considered

The current workaround is to rename all existing configuration from:

```bash
GOOGLE_GENAI_USE_VERTEXAI=true
```

to:

```bash
GOOGLE_GENAI_USE_ENTERPRISE=true
```

This works, but it requires touching configuration that may be spread across many environments. It also introduces friction for a naming change that appears to be mostly semantic from the user's perspective.

Another workaround is to suppress `DeprecationWarning`, but that is too broad and may hide warnings that users actually need to see.

### Proposed API / Implementation

In `google/adk/utils/env_utils.py`, keep the fallback behavior but remove the runtime warning:

```python
def is_enterprise_mode_enabled() -> bool:
if 'GOOGLE_GENAI_USE_ENTERPRISE' in os.environ:
return is_env_enabled('GOOGLE_GENAI_USE_ENTERPRISE')
if 'GOOGLE_GENAI_USE_VERTEXAI' in os.environ:
return is_env_enabled('GOOGLE_GENAI_USE_VERTEXAI')
return False
```

Optionally, documentation can say that `GOOGLE_GENAI_USE_ENTERPRISE` is the preferred name for new projects, while `GOOGLE_GENAI_USE_VERTEXAI` remains supported for existing projects.

### Additional Context

In google-genai SDK, `GOOGLE_GENAI_USE_VERTEXAI` is **not deprecated**
https://github.com/googleapis/python-genai/blob/v2.9.0/google/genai/_api_client.py#L618

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。