Keep GOOGLE_GENAI_USE_VERTEXAI as a long-term alias without runtime deprecation warnings
- Ngôn ngữ chính
- Python
- Star
- 21.5k
- Fork
- 4k
- Merge trung bình
- 1 ngày 14 giờ
- Pull request đã merge (30 ngày)
- 37
Mô tả
** 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
Hướng dẫn đóng góp
Đánh giá
Issue này chưa được đánh giá.