[Reasoning Engine] LangchainAgent.stream_query attempts to import from deprecated langchain.load path
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 55/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Stale
- Tech stack
- python
- Domain
- ai, machine-learning
Research direction
Start with query() and stream_query() in the four affected template files: vertexai/agent_engines/templates/langchain.py, langgraph.py, and the corresponding preview/reasoning_engines templates. Compare the imports and run the template tests or reproduce the LangchainAgent and LanggraphAgent calls; done means both methods no longer fail on the deprecated langchain.load import.
Written by the indexing model from the issue text.
Description
Environment details
- OS type and version: Ubuntu 24.04.4 LTS
- Python version:
3.12.10 - pip version:
25.2 google-cloud-aiplatformversion:Latest from main
Steps to reproduce
- Initialize a
LangchainAgentorLanggraphAgentfrom the agent engine or reasoning engine templates. - Call the
queryorstream_querymethod. - Observe that it fails with an
ImportErrorbecause it attempts to import fromlangchain.loadinstead oflangchain_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.pyvertexai/agent_engines/templates/langgraph.pyvertexai/preview/reasoning_engines/templates/langchain.pyvertexai/preview/reasoning_engines/templates/langgraph.py
Making sure to follow these steps will guarantee the quickest resolution possible.
Thanks!
- Dominant language
- Python
- Stars
- 907
- Forks
- 467
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 44
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from googleapis/python-aiplatform
-
api: vertex-ai
Difficulty 1/5 Under an hour Newbie friendliness 85/100
googleapis/python-aiplatform#7132 ·
-
api: vertex-ai
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
googleapis/python-aiplatform#7097 ·
-
CustomContainerTrainingJob.run drops max_wait_duration=0 instead of requesting indefinite DWS wait Openapi: vertex-ai
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
googleapis/python-aiplatform#7067 · 1 comment ·
-
api: vertex-ai
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
googleapis/python-aiplatform#6877 ·
-
api: vertex-ai
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
googleapis/python-aiplatform#6865 · 1 comment ·
All issues in googleapis/python-aiplatform
Similar issues
-
essnmx good first issue
Difficulty 1/5 Under an hour Newbie friendliness 95/100
-
[Feature] 奇物选择添加优先级 Open
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
syfoud/Simulated_Scepter#174 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Giskard-AI/giskard-oss#2840 · 1 comment ·
-
A claim comment carrying the issue number is silently declined while the workflow reports success Openarea: repo bug perceived difficulty: 2
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
yeti-platform/yeti#1380 ·