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

[Reasoning Engine] LangchainAgent.stream_query attempts to import from deprecated langchain.load path

Đang mở
#6,397 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

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

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
55/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
python
Lĩnh vực
ai, machine-learning

Hướng nghiên cứu

Bắt đầu với query() và stream_query() trong bốn tệp template bị ảnh hưởng: vertexai/agent_engines/templates/langchain.py, langgraph.py và các template preview/reasoning_engines tương ứng. So sánh các import và chạy các bài kiểm thử template hoặc tái hiện các lệnh gọi LangchainAgent và LanggraphAgent; hoàn thành khi cả hai phương thức không còn thất bại do import langchain.load đã lỗi thời.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

api: vertex-ai
Environment details
  • OS type and version: Ubuntu 24.04.4 LTS
  • Python version: 3.12.10
  • pip version: 25.2
  • google-cloud-aiplatform version: Latest from main
Steps to reproduce
  1. Initialize a LangchainAgent or LanggraphAgent from the agent engine or reasoning engine templates.
  2. Call the query or stream_query method.
  3. Observe that it fails with an ImportError because it attempts to import from langchain.load instead of langchain_core.load.
Code example
from vertexai.agent_engines.templates.langchain import LangchainAgent

# Initialize agent
agent = LangchainAgent(model="gemini-1.5-flash-001")
agent.set_up()

# Both query and stream_query are affected
result = agent.query(input="Hello")

for chunk in agent.stream_query(input="Hello"):
    print(chunk)
Stack trace
Traceback (most recent call last):
  File "example.py", line 8, in <module>
    for chunk in agent.stream_query(input="Hello"):
  File ".../vertexai/agent_engines/templates/langchain.py", line 665, in stream_query
    from langchain.load import dump as langchain_load_dump
ImportError: cannot import name 'dump' from 'langchain.load'
Affected files

The same deprecated import (from langchain.load import dump) exists in both query() and stream_query() across all 4 template modules:

  • vertexai/agent_engines/templates/langchain.py
  • vertexai/agent_engines/templates/langgraph.py
  • vertexai/preview/reasoning_engines/templates/langchain.py
  • vertexai/preview/reasoning_engines/templates/langgraph.py

Making sure to follow these steps will guarantee the quickest resolution possible.

Thanks!

Ngôn ngữ chính
Python
Star
908
Fork
468
Merge trung bình
2 ngày 4 giờ
Pull request đã merge (30 ngày)
25

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 googleapis/python-aiplatform

Tất cả issue của googleapis/python-aiplatform

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.