-
Notifications
You must be signed in to change notification settings - Fork 434
Open
Labels
api: vertex-aiIssues related to the googleapis/python-aiplatform API.Issues related to the googleapis/python-aiplatform API.
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!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
api: vertex-aiIssues related to the googleapis/python-aiplatform API.Issues related to the googleapis/python-aiplatform API.