From 22d5e4b7939145874f6867a34e50cf1eefb7e2ce Mon Sep 17 00:00:00 2001 From: ygicp Date: Sun, 8 Mar 2026 19:34:25 +0530 Subject: [PATCH] fix(agent-engines): update langchain import to use langchain_core.load --- .../vertex_langchain/test_agent_engine_templates_langchain.py | 2 +- .../vertex_langchain/test_agent_engine_templates_langgraph.py | 2 +- .../test_reasoning_engine_templates_langchain.py | 2 +- .../test_reasoning_engine_templates_langgraph.py | 2 +- vertexai/agent_engines/templates/langchain.py | 4 ++-- vertexai/agent_engines/templates/langgraph.py | 4 ++-- vertexai/preview/reasoning_engines/templates/langchain.py | 4 ++-- vertexai/preview/reasoning_engines/templates/langgraph.py | 4 ++-- 8 files changed, 12 insertions(+), 12 deletions(-) diff --git a/tests/unit/vertex_langchain/test_agent_engine_templates_langchain.py b/tests/unit/vertex_langchain/test_agent_engine_templates_langchain.py index ef3c99d4eb..78cd74dc32 100644 --- a/tests/unit/vertex_langchain/test_agent_engine_templates_langchain.py +++ b/tests/unit/vertex_langchain/test_agent_engine_templates_langchain.py @@ -27,7 +27,7 @@ from langchain_core import prompts -from langchain.load import dump as langchain_load_dump +from langchain_core.load import dump as langchain_load_dump from langchain.agents.format_scratchpad import format_to_openai_function_messages from langchain.tools.base import StructuredTool diff --git a/tests/unit/vertex_langchain/test_agent_engine_templates_langgraph.py b/tests/unit/vertex_langchain/test_agent_engine_templates_langgraph.py index 21cff50bdf..af5bd3ebd9 100644 --- a/tests/unit/vertex_langchain/test_agent_engine_templates_langgraph.py +++ b/tests/unit/vertex_langchain/test_agent_engine_templates_langgraph.py @@ -24,7 +24,7 @@ import pytest from langchain_core import runnables -from langchain.load import dump as langchain_load_dump +from langchain_core.load import dump as langchain_load_dump from langchain.tools.base import StructuredTool diff --git a/tests/unit/vertex_langchain/test_reasoning_engine_templates_langchain.py b/tests/unit/vertex_langchain/test_reasoning_engine_templates_langchain.py index 2f93b89b82..cf0148e6cf 100644 --- a/tests/unit/vertex_langchain/test_reasoning_engine_templates_langchain.py +++ b/tests/unit/vertex_langchain/test_reasoning_engine_templates_langchain.py @@ -27,7 +27,7 @@ from langchain_core import prompts -from langchain.load import dump as langchain_load_dump +from langchain_core.load import dump as langchain_load_dump from langchain.agents.format_scratchpad import format_to_openai_function_messages from langchain.tools.base import StructuredTool diff --git a/tests/unit/vertex_langchain/test_reasoning_engine_templates_langgraph.py b/tests/unit/vertex_langchain/test_reasoning_engine_templates_langgraph.py index 8215ebfa2b..b8e01b1a1b 100644 --- a/tests/unit/vertex_langchain/test_reasoning_engine_templates_langgraph.py +++ b/tests/unit/vertex_langchain/test_reasoning_engine_templates_langgraph.py @@ -24,7 +24,7 @@ import pytest from langchain_core import runnables -from langchain.load import dump as langchain_load_dump +from langchain_core.load import dump as langchain_load_dump from langchain.tools.base import StructuredTool diff --git a/vertexai/agent_engines/templates/langchain.py b/vertexai/agent_engines/templates/langchain.py index 31dabcbdd3..16c05cf0f5 100644 --- a/vertexai/agent_engines/templates/langchain.py +++ b/vertexai/agent_engines/templates/langchain.py @@ -629,7 +629,7 @@ def query( Returns: The output of querying the Agent with the given input and config. """ - from langchain.load import dump as langchain_load_dump + from langchain_core.load import dump as langchain_load_dump if isinstance(input, str): input = {"input": input} @@ -662,7 +662,7 @@ def stream_query( Yields: The output of querying the Agent with the given input and config. """ - from langchain.load import dump as langchain_load_dump + from langchain_core.load import dump as langchain_load_dump if isinstance(input, str): input = {"input": input} diff --git a/vertexai/agent_engines/templates/langgraph.py b/vertexai/agent_engines/templates/langgraph.py index 9f5295d81a..aff8b305b0 100644 --- a/vertexai/agent_engines/templates/langgraph.py +++ b/vertexai/agent_engines/templates/langgraph.py @@ -554,7 +554,7 @@ def query( Returns: The output of querying the Agent with the given input and config. """ - from langchain.load import dump as langchain_load_dump + from langchain_core.load import dump as langchain_load_dump if isinstance(input, str): input = {"input": input} @@ -587,7 +587,7 @@ def stream_query( Yields: The output of querying the Agent with the given input and config. """ - from langchain.load import dump as langchain_load_dump + from langchain_core.load import dump as langchain_load_dump if isinstance(input, str): input = {"input": input} diff --git a/vertexai/preview/reasoning_engines/templates/langchain.py b/vertexai/preview/reasoning_engines/templates/langchain.py index eddb105d5b..687eb2e790 100644 --- a/vertexai/preview/reasoning_engines/templates/langchain.py +++ b/vertexai/preview/reasoning_engines/templates/langchain.py @@ -605,7 +605,7 @@ def query( Returns: The output of querying the Agent with the given input and config. """ - from langchain.load import dump as langchain_load_dump + from langchain_core.load import dump as langchain_load_dump if isinstance(input, str): input = {"input": input} @@ -636,7 +636,7 @@ def stream_query( Yields: The output of querying the Agent with the given input and config. """ - from langchain.load import dump as langchain_load_dump + from langchain_core.load import dump as langchain_load_dump if isinstance(input, str): input = {"input": input} diff --git a/vertexai/preview/reasoning_engines/templates/langgraph.py b/vertexai/preview/reasoning_engines/templates/langgraph.py index dcc711c867..90f1c335c8 100644 --- a/vertexai/preview/reasoning_engines/templates/langgraph.py +++ b/vertexai/preview/reasoning_engines/templates/langgraph.py @@ -541,7 +541,7 @@ def query( Returns: The output of querying the Agent with the given input and config. """ - from langchain.load import dump as langchain_load_dump + from langchain_core.load import dump as langchain_load_dump if isinstance(input, str): input = {"input": input} @@ -572,7 +572,7 @@ def stream_query( Yields: The output of querying the Agent with the given input and config. """ - from langchain.load import dump as langchain_load_dump + from langchain_core.load import dump as langchain_load_dump if isinstance(input, str): input = {"input": input}