langchain[patch]: Migrate chat models to optional community imports (#21090)

Migrate chat models to optional community imports
pull/21168/head
Eugene Yurtsev 2 months ago committed by GitHub
parent 2914abd747
commit 57e8e70daa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -1,7 +1,28 @@
from langchain_community.chat_models.anthropic import (
ChatAnthropic,
convert_messages_to_prompt_anthropic,
)
from typing import TYPE_CHECKING, Any
from langchain._api import create_importer
if TYPE_CHECKING:
from langchain_community.chat_models.anthropic import (
ChatAnthropic,
convert_messages_to_prompt_anthropic,
)
# Create a way to dynamically look up deprecated imports.
# Used to consolidate logic for raising deprecation warnings and
# handling optional imports.
DEPRECATED_LOOKUP = {
"convert_messages_to_prompt_anthropic": "langchain_community.chat_models.anthropic",
"ChatAnthropic": "langchain_community.chat_models.anthropic",
}
_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
def __getattr__(name: str) -> Any:
"""Look up attributes dynamically."""
return _import_attribute(name)
__all__ = [
"convert_messages_to_prompt_anthropic",

@ -1,5 +1,23 @@
from langchain_community.chat_models.anyscale import (
ChatAnyscale,
)
from typing import TYPE_CHECKING, Any
__all__ = ["ChatAnyscale"]
from langchain._api import create_importer
if TYPE_CHECKING:
from langchain_community.chat_models.anyscale import ChatAnyscale
# Create a way to dynamically look up deprecated imports.
# Used to consolidate logic for raising deprecation warnings and
# handling optional imports.
DEPRECATED_LOOKUP = {"ChatAnyscale": "langchain_community.chat_models.anyscale"}
_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
def __getattr__(name: str) -> Any:
"""Look up attributes dynamically."""
return _import_attribute(name)
__all__ = [
"ChatAnyscale",
]

@ -1,3 +1,23 @@
from langchain_community.chat_models.azure_openai import AzureChatOpenAI
from typing import TYPE_CHECKING, Any
__all__ = ["AzureChatOpenAI"]
from langchain._api import create_importer
if TYPE_CHECKING:
from langchain_community.chat_models.azure_openai import AzureChatOpenAI
# Create a way to dynamically look up deprecated imports.
# Used to consolidate logic for raising deprecation warnings and
# handling optional imports.
DEPRECATED_LOOKUP = {"AzureChatOpenAI": "langchain_community.chat_models.azure_openai"}
_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
def __getattr__(name: str) -> Any:
"""Look up attributes dynamically."""
return _import_attribute(name)
__all__ = [
"AzureChatOpenAI",
]

@ -1,6 +1,30 @@
from langchain_community.chat_models.azureml_endpoint import (
AzureMLChatOnlineEndpoint,
LlamaContentFormatter,
)
from typing import TYPE_CHECKING, Any
__all__ = ["LlamaContentFormatter", "AzureMLChatOnlineEndpoint"]
from langchain._api import create_importer
if TYPE_CHECKING:
from langchain_community.chat_models.azureml_endpoint import (
AzureMLChatOnlineEndpoint,
LlamaContentFormatter,
)
# Create a way to dynamically look up deprecated imports.
# Used to consolidate logic for raising deprecation warnings and
# handling optional imports.
DEPRECATED_LOOKUP = {
"LlamaContentFormatter": "langchain_community.chat_models.azureml_endpoint",
"AzureMLChatOnlineEndpoint": "langchain_community.chat_models.azureml_endpoint",
}
_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
def __getattr__(name: str) -> Any:
"""Look up attributes dynamically."""
return _import_attribute(name)
__all__ = [
"LlamaContentFormatter",
"AzureMLChatOnlineEndpoint",
]

@ -1,6 +1,22 @@
from langchain_community.chat_models.baichuan import (
ChatBaichuan,
)
from typing import TYPE_CHECKING, Any
from langchain._api import create_importer
if TYPE_CHECKING:
from langchain_community.chat_models.baichuan import ChatBaichuan
# Create a way to dynamically look up deprecated imports.
# Used to consolidate logic for raising deprecation warnings and
# handling optional imports.
DEPRECATED_LOOKUP = {"ChatBaichuan": "langchain_community.chat_models.baichuan"}
_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
def __getattr__(name: str) -> Any:
"""Look up attributes dynamically."""
return _import_attribute(name)
__all__ = [
"ChatBaichuan",

@ -1,5 +1,27 @@
from langchain_community.chat_models.baidu_qianfan_endpoint import (
QianfanChatEndpoint,
)
from typing import TYPE_CHECKING, Any
__all__ = ["QianfanChatEndpoint"]
from langchain._api import create_importer
if TYPE_CHECKING:
from langchain_community.chat_models.baidu_qianfan_endpoint import (
QianfanChatEndpoint,
)
# Create a way to dynamically look up deprecated imports.
# Used to consolidate logic for raising deprecation warnings and
# handling optional imports.
DEPRECATED_LOOKUP = {
"QianfanChatEndpoint": "langchain_community.chat_models.baidu_qianfan_endpoint"
}
_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
def __getattr__(name: str) -> Any:
"""Look up attributes dynamically."""
return _import_attribute(name)
__all__ = [
"QianfanChatEndpoint",
]

@ -1,3 +1,27 @@
from langchain_community.chat_models.bedrock import BedrockChat, ChatPromptAdapter
from typing import TYPE_CHECKING, Any
__all__ = ["ChatPromptAdapter", "BedrockChat"]
from langchain._api import create_importer
if TYPE_CHECKING:
from langchain_community.chat_models.bedrock import BedrockChat, ChatPromptAdapter
# Create a way to dynamically look up deprecated imports.
# Used to consolidate logic for raising deprecation warnings and
# handling optional imports.
DEPRECATED_LOOKUP = {
"ChatPromptAdapter": "langchain_community.chat_models.bedrock",
"BedrockChat": "langchain_community.chat_models.bedrock",
}
_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
def __getattr__(name: str) -> Any:
"""Look up attributes dynamically."""
return _import_attribute(name)
__all__ = [
"ChatPromptAdapter",
"BedrockChat",
]

@ -1,5 +1,23 @@
from langchain_community.chat_models.cohere import (
ChatCohere,
)
from typing import TYPE_CHECKING, Any
__all__ = ["ChatCohere"]
from langchain._api import create_importer
if TYPE_CHECKING:
from langchain_community.chat_models.cohere import ChatCohere
# Create a way to dynamically look up deprecated imports.
# Used to consolidate logic for raising deprecation warnings and
# handling optional imports.
DEPRECATED_LOOKUP = {"ChatCohere": "langchain_community.chat_models.cohere"}
_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
def __getattr__(name: str) -> Any:
"""Look up attributes dynamically."""
return _import_attribute(name)
__all__ = [
"ChatCohere",
]

@ -1,3 +1,23 @@
from langchain_community.chat_models.databricks import ChatDatabricks
from typing import TYPE_CHECKING, Any
__all__ = ["ChatDatabricks"]
from langchain._api import create_importer
if TYPE_CHECKING:
from langchain_community.chat_models.databricks import ChatDatabricks
# Create a way to dynamically look up deprecated imports.
# Used to consolidate logic for raising deprecation warnings and
# handling optional imports.
DEPRECATED_LOOKUP = {"ChatDatabricks": "langchain_community.chat_models.databricks"}
_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
def __getattr__(name: str) -> Any:
"""Look up attributes dynamically."""
return _import_attribute(name)
__all__ = [
"ChatDatabricks",
]

@ -1,3 +1,23 @@
from langchain_community.chat_models.ernie import ErnieBotChat
from typing import TYPE_CHECKING, Any
__all__ = ["ErnieBotChat"]
from langchain._api import create_importer
if TYPE_CHECKING:
from langchain_community.chat_models.ernie import ErnieBotChat
# Create a way to dynamically look up deprecated imports.
# Used to consolidate logic for raising deprecation warnings and
# handling optional imports.
DEPRECATED_LOOKUP = {"ErnieBotChat": "langchain_community.chat_models.ernie"}
_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
def __getattr__(name: str) -> Any:
"""Look up attributes dynamically."""
return _import_attribute(name)
__all__ = [
"ErnieBotChat",
]

@ -1,5 +1,23 @@
from langchain_community.chat_models.everlyai import (
ChatEverlyAI,
)
from typing import TYPE_CHECKING, Any
__all__ = ["ChatEverlyAI"]
from langchain._api import create_importer
if TYPE_CHECKING:
from langchain_community.chat_models.everlyai import ChatEverlyAI
# Create a way to dynamically look up deprecated imports.
# Used to consolidate logic for raising deprecation warnings and
# handling optional imports.
DEPRECATED_LOOKUP = {"ChatEverlyAI": "langchain_community.chat_models.everlyai"}
_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
def __getattr__(name: str) -> Any:
"""Look up attributes dynamically."""
return _import_attribute(name)
__all__ = [
"ChatEverlyAI",
]

@ -1,6 +1,30 @@
from langchain_community.chat_models.fake import (
FakeListChatModel,
FakeMessagesListChatModel,
)
from typing import TYPE_CHECKING, Any
__all__ = ["FakeMessagesListChatModel", "FakeListChatModel"]
from langchain._api import create_importer
if TYPE_CHECKING:
from langchain_community.chat_models.fake import (
FakeListChatModel,
FakeMessagesListChatModel,
)
# Create a way to dynamically look up deprecated imports.
# Used to consolidate logic for raising deprecation warnings and
# handling optional imports.
DEPRECATED_LOOKUP = {
"FakeMessagesListChatModel": "langchain_community.chat_models.fake",
"FakeListChatModel": "langchain_community.chat_models.fake",
}
_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
def __getattr__(name: str) -> Any:
"""Look up attributes dynamically."""
return _import_attribute(name)
__all__ = [
"FakeMessagesListChatModel",
"FakeListChatModel",
]

@ -1,6 +1,22 @@
from langchain_community.chat_models.fireworks import (
ChatFireworks,
)
from typing import TYPE_CHECKING, Any
from langchain._api import create_importer
if TYPE_CHECKING:
from langchain_community.chat_models.fireworks import ChatFireworks
# Create a way to dynamically look up deprecated imports.
# Used to consolidate logic for raising deprecation warnings and
# handling optional imports.
DEPRECATED_LOOKUP = {"ChatFireworks": "langchain_community.chat_models.fireworks"}
_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
def __getattr__(name: str) -> Any:
"""Look up attributes dynamically."""
return _import_attribute(name)
__all__ = [
"ChatFireworks",

@ -1,5 +1,23 @@
from langchain_community.chat_models.gigachat import (
GigaChat,
)
from typing import TYPE_CHECKING, Any
__all__ = ["GigaChat"]
from langchain._api import create_importer
if TYPE_CHECKING:
from langchain_community.chat_models.gigachat import GigaChat
# Create a way to dynamically look up deprecated imports.
# Used to consolidate logic for raising deprecation warnings and
# handling optional imports.
DEPRECATED_LOOKUP = {"GigaChat": "langchain_community.chat_models.gigachat"}
_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
def __getattr__(name: str) -> Any:
"""Look up attributes dynamically."""
return _import_attribute(name)
__all__ = [
"GigaChat",
]

@ -1,6 +1,30 @@
from langchain_community.chat_models.google_palm import (
ChatGooglePalm,
ChatGooglePalmError,
)
from typing import TYPE_CHECKING, Any
__all__ = ["ChatGooglePalm", "ChatGooglePalmError"]
from langchain._api import create_importer
if TYPE_CHECKING:
from langchain_community.chat_models.google_palm import (
ChatGooglePalm,
ChatGooglePalmError,
)
# Create a way to dynamically look up deprecated imports.
# Used to consolidate logic for raising deprecation warnings and
# handling optional imports.
DEPRECATED_LOOKUP = {
"ChatGooglePalm": "langchain_community.chat_models.google_palm",
"ChatGooglePalmError": "langchain_community.chat_models.google_palm",
}
_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
def __getattr__(name: str) -> Any:
"""Look up attributes dynamically."""
return _import_attribute(name)
__all__ = [
"ChatGooglePalm",
"ChatGooglePalmError",
]

@ -1,5 +1,23 @@
from langchain_community.chat_models.human import (
HumanInputChatModel,
)
from typing import TYPE_CHECKING, Any
__all__ = ["HumanInputChatModel"]
from langchain._api import create_importer
if TYPE_CHECKING:
from langchain_community.chat_models.human import HumanInputChatModel
# Create a way to dynamically look up deprecated imports.
# Used to consolidate logic for raising deprecation warnings and
# handling optional imports.
DEPRECATED_LOOKUP = {"HumanInputChatModel": "langchain_community.chat_models.human"}
_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
def __getattr__(name: str) -> Any:
"""Look up attributes dynamically."""
return _import_attribute(name)
__all__ = [
"HumanInputChatModel",
]

@ -1,6 +1,22 @@
from langchain_community.chat_models.hunyuan import (
ChatHunyuan,
)
from typing import TYPE_CHECKING, Any
from langchain._api import create_importer
if TYPE_CHECKING:
from langchain_community.chat_models.hunyuan import ChatHunyuan
# Create a way to dynamically look up deprecated imports.
# Used to consolidate logic for raising deprecation warnings and
# handling optional imports.
DEPRECATED_LOOKUP = {"ChatHunyuan": "langchain_community.chat_models.hunyuan"}
_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
def __getattr__(name: str) -> Any:
"""Look up attributes dynamically."""
return _import_attribute(name)
__all__ = [
"ChatHunyuan",

@ -1,6 +1,30 @@
from langchain_community.chat_models.javelin_ai_gateway import (
ChatJavelinAIGateway,
ChatParams,
)
from typing import TYPE_CHECKING, Any
__all__ = ["ChatJavelinAIGateway", "ChatParams"]
from langchain._api import create_importer
if TYPE_CHECKING:
from langchain_community.chat_models.javelin_ai_gateway import (
ChatJavelinAIGateway,
ChatParams,
)
# Create a way to dynamically look up deprecated imports.
# Used to consolidate logic for raising deprecation warnings and
# handling optional imports.
DEPRECATED_LOOKUP = {
"ChatJavelinAIGateway": "langchain_community.chat_models.javelin_ai_gateway",
"ChatParams": "langchain_community.chat_models.javelin_ai_gateway",
}
_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
def __getattr__(name: str) -> Any:
"""Look up attributes dynamically."""
return _import_attribute(name)
__all__ = [
"ChatJavelinAIGateway",
"ChatParams",
]

@ -1,6 +1,22 @@
from langchain_community.chat_models.jinachat import (
JinaChat,
)
from typing import TYPE_CHECKING, Any
from langchain._api import create_importer
if TYPE_CHECKING:
from langchain_community.chat_models.jinachat import JinaChat
# Create a way to dynamically look up deprecated imports.
# Used to consolidate logic for raising deprecation warnings and
# handling optional imports.
DEPRECATED_LOOKUP = {"JinaChat": "langchain_community.chat_models.jinachat"}
_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
def __getattr__(name: str) -> Any:
"""Look up attributes dynamically."""
return _import_attribute(name)
__all__ = [
"JinaChat",

@ -1,5 +1,23 @@
from langchain_community.chat_models.konko import (
ChatKonko,
)
from typing import TYPE_CHECKING, Any
__all__ = ["ChatKonko"]
from langchain._api import create_importer
if TYPE_CHECKING:
from langchain_community.chat_models.konko import ChatKonko
# Create a way to dynamically look up deprecated imports.
# Used to consolidate logic for raising deprecation warnings and
# handling optional imports.
DEPRECATED_LOOKUP = {"ChatKonko": "langchain_community.chat_models.konko"}
_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
def __getattr__(name: str) -> Any:
"""Look up attributes dynamically."""
return _import_attribute(name)
__all__ = [
"ChatKonko",
]

@ -1,3 +1,30 @@
from langchain_community.chat_models.litellm import ChatLiteLLM, ChatLiteLLMException
from typing import TYPE_CHECKING, Any
__all__ = ["ChatLiteLLM", "ChatLiteLLMException"]
from langchain._api import create_importer
if TYPE_CHECKING:
from langchain_community.chat_models.litellm import (
ChatLiteLLM,
ChatLiteLLMException,
)
# Create a way to dynamically look up deprecated imports.
# Used to consolidate logic for raising deprecation warnings and
# handling optional imports.
DEPRECATED_LOOKUP = {
"ChatLiteLLM": "langchain_community.chat_models.litellm",
"ChatLiteLLMException": "langchain_community.chat_models.litellm",
}
_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
def __getattr__(name: str) -> Any:
"""Look up attributes dynamically."""
return _import_attribute(name)
__all__ = [
"ChatLiteLLM",
"ChatLiteLLMException",
]

@ -1,5 +1,25 @@
from langchain_community.chat_models.meta import (
convert_messages_to_prompt_llama,
)
from typing import TYPE_CHECKING, Any
__all__ = ["convert_messages_to_prompt_llama"]
from langchain._api import create_importer
if TYPE_CHECKING:
from langchain_community.chat_models.meta import convert_messages_to_prompt_llama
# Create a way to dynamically look up deprecated imports.
# Used to consolidate logic for raising deprecation warnings and
# handling optional imports.
DEPRECATED_LOOKUP = {
"convert_messages_to_prompt_llama": "langchain_community.chat_models.meta"
}
_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
def __getattr__(name: str) -> Any:
"""Look up attributes dynamically."""
return _import_attribute(name)
__all__ = [
"convert_messages_to_prompt_llama",
]

@ -1,5 +1,23 @@
from langchain_community.chat_models.minimax import (
MiniMaxChat,
)
from typing import TYPE_CHECKING, Any
__all__ = ["MiniMaxChat"]
from langchain._api import create_importer
if TYPE_CHECKING:
from langchain_community.chat_models.minimax import MiniMaxChat
# Create a way to dynamically look up deprecated imports.
# Used to consolidate logic for raising deprecation warnings and
# handling optional imports.
DEPRECATED_LOOKUP = {"MiniMaxChat": "langchain_community.chat_models.minimax"}
_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
def __getattr__(name: str) -> Any:
"""Look up attributes dynamically."""
return _import_attribute(name)
__all__ = [
"MiniMaxChat",
]

@ -1,3 +1,23 @@
from langchain_community.chat_models.mlflow import ChatMlflow
from typing import TYPE_CHECKING, Any
__all__ = ["ChatMlflow"]
from langchain._api import create_importer
if TYPE_CHECKING:
from langchain_community.chat_models.mlflow import ChatMlflow
# Create a way to dynamically look up deprecated imports.
# Used to consolidate logic for raising deprecation warnings and
# handling optional imports.
DEPRECATED_LOOKUP = {"ChatMlflow": "langchain_community.chat_models.mlflow"}
_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
def __getattr__(name: str) -> Any:
"""Look up attributes dynamically."""
return _import_attribute(name)
__all__ = [
"ChatMlflow",
]

@ -1,6 +1,30 @@
from langchain_community.chat_models.mlflow_ai_gateway import (
ChatMLflowAIGateway,
ChatParams,
)
from typing import TYPE_CHECKING, Any
__all__ = ["ChatMLflowAIGateway", "ChatParams"]
from langchain._api import create_importer
if TYPE_CHECKING:
from langchain_community.chat_models.mlflow_ai_gateway import (
ChatMLflowAIGateway,
ChatParams,
)
# Create a way to dynamically look up deprecated imports.
# Used to consolidate logic for raising deprecation warnings and
# handling optional imports.
DEPRECATED_LOOKUP = {
"ChatMLflowAIGateway": "langchain_community.chat_models.mlflow_ai_gateway",
"ChatParams": "langchain_community.chat_models.mlflow_ai_gateway",
}
_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
def __getattr__(name: str) -> Any:
"""Look up attributes dynamically."""
return _import_attribute(name)
__all__ = [
"ChatMLflowAIGateway",
"ChatParams",
]

@ -1,5 +1,23 @@
from langchain_community.chat_models.ollama import (
ChatOllama,
)
from typing import TYPE_CHECKING, Any
__all__ = ["ChatOllama"]
from langchain._api import create_importer
if TYPE_CHECKING:
from langchain_community.chat_models.ollama import ChatOllama
# Create a way to dynamically look up deprecated imports.
# Used to consolidate logic for raising deprecation warnings and
# handling optional imports.
DEPRECATED_LOOKUP = {"ChatOllama": "langchain_community.chat_models.ollama"}
_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
def __getattr__(name: str) -> Any:
"""Look up attributes dynamically."""
return _import_attribute(name)
__all__ = [
"ChatOllama",
]

@ -1,6 +1,22 @@
from langchain_community.chat_models.openai import (
ChatOpenAI,
)
from typing import TYPE_CHECKING, Any
from langchain._api import create_importer
if TYPE_CHECKING:
from langchain_community.chat_models.openai import ChatOpenAI
# Create a way to dynamically look up deprecated imports.
# Used to consolidate logic for raising deprecation warnings and
# handling optional imports.
DEPRECATED_LOOKUP = {"ChatOpenAI": "langchain_community.chat_models.openai"}
_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
def __getattr__(name: str) -> Any:
"""Look up attributes dynamically."""
return _import_attribute(name)
__all__ = [
"ChatOpenAI",

@ -1,3 +1,25 @@
from langchain_community.chat_models.pai_eas_endpoint import PaiEasChatEndpoint
from typing import TYPE_CHECKING, Any
__all__ = ["PaiEasChatEndpoint"]
from langchain._api import create_importer
if TYPE_CHECKING:
from langchain_community.chat_models.pai_eas_endpoint import PaiEasChatEndpoint
# Create a way to dynamically look up deprecated imports.
# Used to consolidate logic for raising deprecation warnings and
# handling optional imports.
DEPRECATED_LOOKUP = {
"PaiEasChatEndpoint": "langchain_community.chat_models.pai_eas_endpoint"
}
_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
def __getattr__(name: str) -> Any:
"""Look up attributes dynamically."""
return _import_attribute(name)
__all__ = [
"PaiEasChatEndpoint",
]

@ -1,3 +1,25 @@
from langchain_community.chat_models.promptlayer_openai import PromptLayerChatOpenAI
from typing import TYPE_CHECKING, Any
__all__ = ["PromptLayerChatOpenAI"]
from langchain._api import create_importer
if TYPE_CHECKING:
from langchain_community.chat_models.promptlayer_openai import PromptLayerChatOpenAI
# Create a way to dynamically look up deprecated imports.
# Used to consolidate logic for raising deprecation warnings and
# handling optional imports.
DEPRECATED_LOOKUP = {
"PromptLayerChatOpenAI": "langchain_community.chat_models.promptlayer_openai"
}
_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
def __getattr__(name: str) -> Any:
"""Look up attributes dynamically."""
return _import_attribute(name)
__all__ = [
"PromptLayerChatOpenAI",
]

@ -1,6 +1,22 @@
from langchain_community.chat_models.tongyi import (
ChatTongyi,
)
from typing import TYPE_CHECKING, Any
from langchain._api import create_importer
if TYPE_CHECKING:
from langchain_community.chat_models.tongyi import ChatTongyi
# Create a way to dynamically look up deprecated imports.
# Used to consolidate logic for raising deprecation warnings and
# handling optional imports.
DEPRECATED_LOOKUP = {"ChatTongyi": "langchain_community.chat_models.tongyi"}
_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
def __getattr__(name: str) -> Any:
"""Look up attributes dynamically."""
return _import_attribute(name)
__all__ = [
"ChatTongyi",

@ -1,6 +1,22 @@
from langchain_community.chat_models.vertexai import (
ChatVertexAI,
)
from typing import TYPE_CHECKING, Any
from langchain._api import create_importer
if TYPE_CHECKING:
from langchain_community.chat_models.vertexai import ChatVertexAI
# Create a way to dynamically look up deprecated imports.
# Used to consolidate logic for raising deprecation warnings and
# handling optional imports.
DEPRECATED_LOOKUP = {"ChatVertexAI": "langchain_community.chat_models.vertexai"}
_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
def __getattr__(name: str) -> Any:
"""Look up attributes dynamically."""
return _import_attribute(name)
__all__ = [
"ChatVertexAI",

@ -1,6 +1,30 @@
from langchain_community.chat_models.volcengine_maas import (
VolcEngineMaasChat,
convert_dict_to_message,
)
from typing import TYPE_CHECKING, Any
__all__ = ["convert_dict_to_message", "VolcEngineMaasChat"]
from langchain._api import create_importer
if TYPE_CHECKING:
from langchain_community.chat_models.volcengine_maas import (
VolcEngineMaasChat,
convert_dict_to_message,
)
# Create a way to dynamically look up deprecated imports.
# Used to consolidate logic for raising deprecation warnings and
# handling optional imports.
DEPRECATED_LOOKUP = {
"convert_dict_to_message": "langchain_community.chat_models.volcengine_maas",
"VolcEngineMaasChat": "langchain_community.chat_models.volcengine_maas",
}
_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
def __getattr__(name: str) -> Any:
"""Look up attributes dynamically."""
return _import_attribute(name)
__all__ = [
"convert_dict_to_message",
"VolcEngineMaasChat",
]

@ -1,5 +1,23 @@
from langchain_community.chat_models.yandex import (
ChatYandexGPT,
)
from typing import TYPE_CHECKING, Any
__all__ = ["ChatYandexGPT"]
from langchain._api import create_importer
if TYPE_CHECKING:
from langchain_community.chat_models.yandex import ChatYandexGPT
# Create a way to dynamically look up deprecated imports.
# Used to consolidate logic for raising deprecation warnings and
# handling optional imports.
DEPRECATED_LOOKUP = {"ChatYandexGPT": "langchain_community.chat_models.yandex"}
_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
def __getattr__(name: str) -> Any:
"""Look up attributes dynamically."""
return _import_attribute(name)
__all__ = [
"ChatYandexGPT",
]

Loading…
Cancel
Save