From 45f2fd5a70b8df54a919c47dc16b0a02c87b0f15 Mon Sep 17 00:00:00 2001 From: Leonid Kuligin Date: Mon, 18 Dec 2023 10:51:03 +0100 Subject: [PATCH] moved imports --- .../langchain_community/utils/vertex_functions.py | 2 +- .../integration_tests/chat_models/test_vertexai.py | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/libs/community/langchain_community/utils/vertex_functions.py b/libs/community/langchain_community/utils/vertex_functions.py index ba014135b85c8..f04b3b41eeb59 100644 --- a/libs/community/langchain_community/utils/vertex_functions.py +++ b/libs/community/langchain_community/utils/vertex_functions.py @@ -1,6 +1,6 @@ from typing import TYPE_CHECKING -from langchain.agents import Tool +from langchain_core.tools import Tool from langchain_community.utils.openai_functions import ( FunctionDescription, diff --git a/libs/community/tests/integration_tests/chat_models/test_vertexai.py b/libs/community/tests/integration_tests/chat_models/test_vertexai.py index dcf6837ac3066..580cc590ffcc7 100644 --- a/libs/community/tests/integration_tests/chat_models/test_vertexai.py +++ b/libs/community/tests/integration_tests/chat_models/test_vertexai.py @@ -11,11 +11,6 @@ from unittest.mock import MagicMock, Mock, patch import pytest -from langchain.agents import AgentExecutor, Tool -from langchain.agents.format_scratchpad import format_to_openai_function_messages -from langchain.agents.output_parsers import VertexAIFunctionsAgentOutputParser -from langchain.chains import LLMMathChain -from langchain.prompts import ChatPromptTemplate, MessagesPlaceholder from langchain_core.messages import ( AIMessage, AIMessageChunk, @@ -302,6 +297,12 @@ def test_parse_examples_failes_wrong_sequence() -> None: def test_tools() -> None: + from langchain.agents import AgentExecutor, Tool + from langchain.agents.format_scratchpad import format_to_openai_function_messages + from langchain.agents.output_parsers import VertexAIFunctionsAgentOutputParser + from langchain.chains import LLMMathChain + from langchain.prompts import ChatPromptTemplate, MessagesPlaceholder + llm = ChatVertexAI(model_name="gemini-pro") math_chain = LLMMathChain.from_llm(llm=llm) raw_tools = [