dependencies/vertexai.py eagerly imports the deprecated vertexai.preview.rag, so every evaluation import warns
维护者通常 6 天内回复
评估
调研方向
阅读 src/google/adk/dependencies/vertexai.py 并检查其模块级导入,然后检查 evaluation/vertex_ai_eval_facade.py 和 tools/retrieval/vertex_ai_rag_retrieval.py,以了解哪些代码需要 RAG。运行复现命令,并将警告视为错误。完成的标准是:导入评估 facade 不再引发异常或发出 RAG 弃用警告,同时 RAG 功能仍可用。
由索引模型根据 Issue 内容生成。
描述
Required Information
Describe the Bug:
google/adk/dependencies/vertexai.py imports vertexai.preview.rag at module level. Since google-cloud-aiplatform deprecated that module, the import emits a UserWarning on load. Every ADK module that imports anything from ..dependencies.vertexai therefore triggers it, even when it only needs vertexai itself. That includes evaluation/vertex_ai_eval_facade.py:29 (from ..dependencies.vertexai import vertexai) and the other evaluation modules. As a result, every AgentEvaluator / adk eval run prints the deprecation warning, although no RAG code is used. Under -W error::UserWarning (or filterwarnings = error in pytest) the import fails.
The code is unchanged on main (d4e092e997): src/google/adk/dependencies/vertexai.py:19 still reads from vertexai.preview import rag as rag.
Steps to Reproduce:
pip install "google-adk[eval]==2.11.0" "google-cloud-aiplatform==1.163.0".python -W error::UserWarning -c "import google.adk.evaluation.vertex_ai_eval_facade"
Expected Behavior:
Importing ADK's evaluation modules emits no deprecation warning for a module they do not use. The RAG import should happen only where RAG is used (tools/retrieval/vertex_ai_rag_retrieval.py already imports it only under TYPE_CHECKING, line 35, and inside the call, line 103), or move to the replacement client.
Observed Behavior:
File ".../google/adk/evaluation/vertex_ai_eval_facade.py", line 29, in <module>
File ".../google/adk/dependencies/vertexai.py", line 19, in <module>
File ".../vertexai/preview/rag/__init__.py", line 186, in <module>
UserWarning: The `vertexai.preview.rag` module is deprecated and will be removed in a future version. Please migrate to the `agentplatform` client. For example:
import agentplatform
client = agentplatform.Client(project="your-project", location="us-central1")
client.rag.create_corpus(...)
Without -W error, the same warning appears in pytest's warnings summary of every evaluation test.
Environment Details:
- ADK Library Version: 2.11.0 (code identical on
maind4e092e997) - Desktop OS: macOS 27.2
- Python Version: 3.12.8
Model Information:
- Are you using LiteLLM: No
- Which model is being used: N/A (import-time behaviour)
Optional Information
Regression:
The ADK code is not new. The warning appears with google-cloud-aiplatform 1.163.0, which deprecates vertexai.preview.rag. Once that module is removed, the import in dependencies/vertexai.py would fail outright, taking the evaluation modules with it.
Possible fix:
Drop the eager from vertexai.preview import rag from dependencies/vertexai.py. Let the RAG retrieval tool import vertexai.preview.rag inside the call, where it already defers the import, or migrate it to the agentplatform client the deprecation message names. example_stores, imported the same way, emits no warning today.
- 主要语言
- Python
- 星标
- 21.6k
- 派生
- 4k
- 平均合并
- 9 小时 59 分钟
- 30 天内合并 PR
- 5
环境准备
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
google/adk-python 的其他 Issue
-
CI Mypy Check flags an existing streaming_utils.py error as new because the PR run reuses the baseline's mypy cache可能已有人在做 @jennymeshaiah09 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
google/adk-python#7409 ·
维护者通常 6 天内回复
-
A2aAgentExecutor sends the raw exception text to the A2A caller when the run fails可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭a2a
难度 2/5 1-3 小时 新手友好度 84/100
google/adk-python#7385 · 1 条评论 · 已指派 1 人 ·
维护者通常 6 天内回复
-
web
难度 2/5 1-3 小时 新手友好度 62/100
google/adk-python#7381 · 已指派 1 人 ·
维护者通常 6 天内回复
-
[A2A] RemoteA2aAgent(use_legacy=False): extension header written to state['http_kwargs'], ignored by a2a-sdk 1.x transports可能已有人在做 @surajksharma07 于 7 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 84/100
google/adk-python#7334 · 2 条评论 · 已指派 1 人 ·
维护者通常 6 天内回复
-
RestApiTool raises uncaught KeyError when a required path param is omitted可能已有人在做 @llalitkumarrr 于 8 天前认领。 未关闭request clarification tools
难度 2/5 1-3 小时 新手友好度 78/100
google/adk-python#7282 · 5 条评论 · 已指派 1 人 ·
维护者通常 6 天内回复
查看 google/adk-python 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 3 天内回复
-
难度 2/5 1-3 小时 新手友好度 88/100
modelcontextprotocol/python-sdk#3648 ·
维护者通常 1 天内回复
-
docs good first issue
难度 2/5 1-3 小时 新手友好度 78/100
VenetoStato/giorgio#6 ·
-
难度 2/5 1-3 小时 新手友好度 74/100
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 70/100
EclipseFdn/open-vsx.org#13831 ·
维护者通常 1 天内回复