Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

dependencies/vertexai.py eagerly imports the deprecated vertexai.preview.rag, so every evaluation import warns

Đã đóng Phù hợp với người mới
#7,415 2 bình luận 0 reaction 1 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 6 ngày

@llalitkumarrr đang làm issue này rồi.

Từ ngày 6/10/2026.

  • #7417 của @a2105z — đang mở

Đá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
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
python
Lĩnh vực
backend

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:

  1. pip install "google-adk[eval]==2.11.0" "google-cloud-aiplatform==1.163.0".
  2. 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 main d4e092e997)
  • 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

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của google/adk-python

Tất cả issue của google/adk-python

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.