Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

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

Aperta
#6,397 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 5 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
55/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
python

Direzione di ricerca

Inizia con query() e stream_query() nei quattro file di template interessati: vertexai/agent_engines/templates/langchain.py, langgraph.py e i template corrispondenti di preview/reasoning_engines. Confronta gli import ed esegui i test dei template oppure riproduci le chiamate a LangchainAgent e LanggraphAgent; il lavoro è completato quando entrambi i metodi non falliscono più a causa dell’import obsoleto langchain.load.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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!

Lingua principale
Python
Stelle
907
Fork
467
Merge medio
1g 11h
PR unite (30g)
35

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di googleapis/python-aiplatform

Tutte le issue di googleapis/python-aiplatform

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.