dependencies/vertexai.py eagerly imports the deprecated vertexai.preview.rag, so every evaluation import warns
維護者通常 4 天內回覆
評估
研究方向
閱讀 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.9k
- 分支
- 4.2k
- 平均合併
- 3 天 16 小時
- 30 天內合併 PR
- 6
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
google/adk-python 的其他 Issue
-
Update opentelemetry-api and opentelemetry-sdk to 1.44.0可能已有人在做 @llalitkumarrr 於 11 天前認領。 未關閉request clarification tracing
難度 2/5 1-3 小時 新手友好度 70/100
google/adk-python#7433 · 5 則留言 · 已指派 1 人 ·
維護者通常 4 天內回覆
-
CI Mypy Check flags an existing streaming_utils.py error as new because the PR run reuses the baseline's mypy cache可能已有人在做 @DeanChensj 於 13 天前認領。 未關閉needs review
難度 2/5 1-3 小時 新手友好度 72/100
google/adk-python#7409 · 1 則留言 · 已指派 2 人 ·
維護者通常 4 天內回覆
-
A2aAgentExecutor sends the raw exception text to the A2A caller when the run fails可能已有人在做 @sanketpatil06 於 14 天前認領。 未關閉a2a request clarification
難度 2/5 1-3 小時 新手友好度 84/100
google/adk-python#7385 · 2 則留言 · 已指派 1 人 ·
維護者通常 4 天內回覆
-
Please support mermaid 12 (inbuild elk) in `adk web`可能已有人在做 @sanketpatil06 於 14 天前認領。 未關閉needs review web
難度 2/5 1-3 小時 新手友好度 62/100
google/adk-python#7381 · 1 則留言 · 已指派 1 人 ·
維護者通常 4 天內回覆
-
[A2A] RemoteA2aAgent(use_legacy=False): extension header written to state['http_kwargs'], ignored by a2a-sdk 1.x transports可能已有人在做 @surajksharma07 於 21 天前認領。 未關閉a2a
難度 2/5 1-3 小時 新手友好度 84/100
google/adk-python#7334 · 2 則留言 · 已指派 1 人 ·
維護者通常 4 天內回覆
查看 google/adk-python 的全部 Issue
相似的 Issue
-
bug
難度 2/5 1-3 小時 新手友好度 79/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 78/100
mohitmishra786/readprism#322 ·
維護者通常 1 天內回覆
-
good first issue
難度 2/5 1-3 小時 新手友好度 76/100
-
難度 1/5 1 小時以內 新手友好度 75/100
維護者通常 1 天內回覆
-
API-key credentials accept a blank key: empty via the API, spaces-only via the builder's Add API key dialog可能已有人在做 關聯的 PR 仍在進行中或已合併。 未關閉
難度 2/5 1-3 小時 新手友好度 77/100
Significant-Gravitas/AutoGPT#15727 ·
維護者通常 1 天內回覆