dependencies/vertexai.py eagerly imports the deprecated vertexai.preview.rag, so every evaluation import warns
Maintainer thường phản hồi trong vòng 6 ngày
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 74/100
Hướng nghiên cứu
Đọc src/google/adk/dependencies/vertexai.py và kiểm tra các import ở cấp mô-đun. Sau đó, kiểm tra evaluation/vertex_ai_eval_facade.py và tools/retrieval/vertex_ai_rag_retrieval.py để hiểu đoạn mã nào cần RAG. Chạy lệnh tái hiện với các cảnh báo được xử lý như lỗi. Công việc được xem là hoàn tất khi việc import facade đánh giá không còn gây ra ngoại lệ hoặc phát ra cảnh báo RAG đã lỗi thời, trong khi chức năng RAG vẫn khả dụng.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Python
- Star
- 21.6k
- Fork
- 4k
- Merge trung bình
- 1 ngày 13 giờ
- Pull request đã merge (30 ngày)
- 6
Chuẩn bị môi trường
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của google/adk-python
-
after_model_callback: a replacement LlmResponse drops `usage_metadata`, erasing the model call from token accountingCó thể đã có người làm @zhuhongd đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
google/adk-python#7451 ·
Maintainer thường phản hồi trong vòng 6 ngày
-
GKE code executor unit tests fail with kubernetes 37.0.0, turning main CI redCó thể đã có người làm @vetler đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
google/adk-python#7443 ·
Maintainer thường phản hồi trong vòng 6 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
google/adk-python#7433 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 6 ngày
-
CI Mypy Check flags an existing streaming_utils.py error as new because the PR run reuses the baseline's mypy cacheCó thể đã có người làm @DeanChensj đã nhận 2 ngày trước. Đang mởneeds review
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
google/adk-python#7409 · 1 bình luận · 2 người được giao ·
Maintainer thường phản hồi trong vòng 6 ngày
-
A2aAgentExecutor sends the raw exception text to the A2A caller when the run failsCó thể đã có người làm @sanketpatil06 đã nhận 3 ngày trước. Đang mởa2a request clarification
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
google/adk-python#7385 · 2 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 6 ngày
Tất cả issue của google/adk-python
Issue tương tự
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
epam/ai-dial-quickapps-backend#628 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
0xlau.dev 已失效,切换成 timlau.meĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 69/100
timqian/chinese-independent-blogs#2235 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
eclipse-score/coverage_tool#27 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
bojieli/ai-agent-book#1174 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
RedHatQE/mtv-api-tests#721 ·
Maintainer thường phản hồi trong vòng 1 ngày