From cc76f0e834b7e57aadb699b97586e33b2c917525 Mon Sep 17 00:00:00 2001 From: Bagatur <22008038+baskaryan@users.noreply.github.com> Date: Wed, 6 Dec 2023 11:45:05 -0800 Subject: [PATCH] langchain[patch]: import nits (#14354) import from core instead of langchain.schema --- libs/langchain/langchain/llms/watsonxllm.py | 3 ++- .../chat_models/test_volcengine_maas.py | 10 +++------- .../integration_tests/llms/test_volcengine_maas.py | 3 ++- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/libs/langchain/langchain/llms/watsonxllm.py b/libs/langchain/langchain/llms/watsonxllm.py index 36ad7fdb17127..40005437816bf 100644 --- a/libs/langchain/langchain/llms/watsonxllm.py +++ b/libs/langchain/langchain/llms/watsonxllm.py @@ -2,10 +2,11 @@ import os from typing import Any, Dict, Iterator, List, Mapping, Optional, Union +from langchain_core.outputs import LLMResult + from langchain.callbacks.manager import CallbackManagerForLLMRun from langchain.llms.base import BaseLLM from langchain.pydantic_v1 import Extra, SecretStr, root_validator -from langchain.schema import LLMResult from langchain.schema.output import Generation, GenerationChunk from langchain.utils import convert_to_secret_str, get_from_dict_or_env diff --git a/libs/langchain/tests/integration_tests/chat_models/test_volcengine_maas.py b/libs/langchain/tests/integration_tests/chat_models/test_volcengine_maas.py index 31800b9a4e70e..bb52a50d7ae9c 100644 --- a/libs/langchain/tests/integration_tests/chat_models/test_volcengine_maas.py +++ b/libs/langchain/tests/integration_tests/chat_models/test_volcengine_maas.py @@ -1,14 +1,10 @@ """Test volc engine maas chat model.""" +from langchain_core.messages import AIMessage, BaseMessage, HumanMessage +from langchain_core.outputs import ChatGeneration, LLMResult + from langchain.callbacks.manager import CallbackManager from langchain.chat_models.volcengine_maas import VolcEngineMaasChat -from langchain.schema import ( - AIMessage, - BaseMessage, - ChatGeneration, - HumanMessage, - LLMResult, -) from tests.unit_tests.callbacks.fake_callback_handler import FakeCallbackHandler diff --git a/libs/langchain/tests/integration_tests/llms/test_volcengine_maas.py b/libs/langchain/tests/integration_tests/llms/test_volcengine_maas.py index 22a357034d466..9bbb7138653c7 100644 --- a/libs/langchain/tests/integration_tests/llms/test_volcengine_maas.py +++ b/libs/langchain/tests/integration_tests/llms/test_volcengine_maas.py @@ -2,8 +2,9 @@ from typing import Generator +from langchain_core.outputs import LLMResult + from langchain.llms.volcengine_maas import VolcEngineMaasLLM -from langchain.schema import LLMResult def test_default_call() -> None: