mirror of
https://github.com/hwchase17/langchain.git
synced 2025-07-01 02:43:37 +00:00
langchain[patch]: Migrate chat models to optional community imports (#21090)
Migrate chat models to optional community imports
This commit is contained in:
parent
2914abd747
commit
57e8e70daa
@ -1,8 +1,29 @@
|
|||||||
|
from typing import TYPE_CHECKING, Any
|
||||||
|
|
||||||
|
from langchain._api import create_importer
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
from langchain_community.chat_models.anthropic import (
|
from langchain_community.chat_models.anthropic import (
|
||||||
ChatAnthropic,
|
ChatAnthropic,
|
||||||
convert_messages_to_prompt_anthropic,
|
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__ = [
|
__all__ = [
|
||||||
"convert_messages_to_prompt_anthropic",
|
"convert_messages_to_prompt_anthropic",
|
||||||
"ChatAnthropic",
|
"ChatAnthropic",
|
||||||
|
@ -1,5 +1,23 @@
|
|||||||
from langchain_community.chat_models.anyscale import (
|
from typing import TYPE_CHECKING, Any
|
||||||
ChatAnyscale,
|
|
||||||
)
|
|
||||||
|
|
||||||
__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 typing import TYPE_CHECKING, Any
|
||||||
|
|
||||||
|
from langchain._api import create_importer
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
from langchain_community.chat_models.azure_openai import AzureChatOpenAI
|
from langchain_community.chat_models.azure_openai import AzureChatOpenAI
|
||||||
|
|
||||||
__all__ = ["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 typing import TYPE_CHECKING, Any
|
||||||
|
|
||||||
|
from langchain._api import create_importer
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
from langchain_community.chat_models.azureml_endpoint import (
|
from langchain_community.chat_models.azureml_endpoint import (
|
||||||
AzureMLChatOnlineEndpoint,
|
AzureMLChatOnlineEndpoint,
|
||||||
LlamaContentFormatter,
|
LlamaContentFormatter,
|
||||||
)
|
)
|
||||||
|
|
||||||
__all__ = ["LlamaContentFormatter", "AzureMLChatOnlineEndpoint"]
|
# 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 (
|
from typing import TYPE_CHECKING, Any
|
||||||
ChatBaichuan,
|
|
||||||
)
|
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__ = [
|
__all__ = [
|
||||||
"ChatBaichuan",
|
"ChatBaichuan",
|
||||||
|
@ -1,5 +1,27 @@
|
|||||||
|
from typing import TYPE_CHECKING, Any
|
||||||
|
|
||||||
|
from langchain._api import create_importer
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
from langchain_community.chat_models.baidu_qianfan_endpoint import (
|
from langchain_community.chat_models.baidu_qianfan_endpoint import (
|
||||||
QianfanChatEndpoint,
|
QianfanChatEndpoint,
|
||||||
)
|
)
|
||||||
|
|
||||||
__all__ = ["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 typing import TYPE_CHECKING, Any
|
||||||
|
|
||||||
|
from langchain._api import create_importer
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
from langchain_community.chat_models.bedrock import BedrockChat, ChatPromptAdapter
|
from langchain_community.chat_models.bedrock import BedrockChat, ChatPromptAdapter
|
||||||
|
|
||||||
__all__ = ["ChatPromptAdapter", "BedrockChat"]
|
# 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 (
|
from typing import TYPE_CHECKING, Any
|
||||||
ChatCohere,
|
|
||||||
)
|
|
||||||
|
|
||||||
__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 typing import TYPE_CHECKING, Any
|
||||||
|
|
||||||
|
from langchain._api import create_importer
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
from langchain_community.chat_models.databricks import ChatDatabricks
|
from langchain_community.chat_models.databricks import ChatDatabricks
|
||||||
|
|
||||||
__all__ = ["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 typing import TYPE_CHECKING, Any
|
||||||
|
|
||||||
|
from langchain._api import create_importer
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
from langchain_community.chat_models.ernie import ErnieBotChat
|
from langchain_community.chat_models.ernie import ErnieBotChat
|
||||||
|
|
||||||
__all__ = ["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 (
|
from typing import TYPE_CHECKING, Any
|
||||||
ChatEverlyAI,
|
|
||||||
)
|
|
||||||
|
|
||||||
__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 typing import TYPE_CHECKING, Any
|
||||||
|
|
||||||
|
from langchain._api import create_importer
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
from langchain_community.chat_models.fake import (
|
from langchain_community.chat_models.fake import (
|
||||||
FakeListChatModel,
|
FakeListChatModel,
|
||||||
FakeMessagesListChatModel,
|
FakeMessagesListChatModel,
|
||||||
)
|
)
|
||||||
|
|
||||||
__all__ = ["FakeMessagesListChatModel", "FakeListChatModel"]
|
# 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 (
|
from typing import TYPE_CHECKING, Any
|
||||||
ChatFireworks,
|
|
||||||
)
|
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__ = [
|
__all__ = [
|
||||||
"ChatFireworks",
|
"ChatFireworks",
|
||||||
|
@ -1,5 +1,23 @@
|
|||||||
from langchain_community.chat_models.gigachat import (
|
from typing import TYPE_CHECKING, Any
|
||||||
GigaChat,
|
|
||||||
)
|
|
||||||
|
|
||||||
__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 typing import TYPE_CHECKING, Any
|
||||||
|
|
||||||
|
from langchain._api import create_importer
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
from langchain_community.chat_models.google_palm import (
|
from langchain_community.chat_models.google_palm import (
|
||||||
ChatGooglePalm,
|
ChatGooglePalm,
|
||||||
ChatGooglePalmError,
|
ChatGooglePalmError,
|
||||||
)
|
)
|
||||||
|
|
||||||
__all__ = ["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 (
|
from typing import TYPE_CHECKING, Any
|
||||||
HumanInputChatModel,
|
|
||||||
)
|
|
||||||
|
|
||||||
__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 (
|
from typing import TYPE_CHECKING, Any
|
||||||
ChatHunyuan,
|
|
||||||
)
|
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__ = [
|
__all__ = [
|
||||||
"ChatHunyuan",
|
"ChatHunyuan",
|
||||||
|
@ -1,6 +1,30 @@
|
|||||||
|
from typing import TYPE_CHECKING, Any
|
||||||
|
|
||||||
|
from langchain._api import create_importer
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
from langchain_community.chat_models.javelin_ai_gateway import (
|
from langchain_community.chat_models.javelin_ai_gateway import (
|
||||||
ChatJavelinAIGateway,
|
ChatJavelinAIGateway,
|
||||||
ChatParams,
|
ChatParams,
|
||||||
)
|
)
|
||||||
|
|
||||||
__all__ = ["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 (
|
from typing import TYPE_CHECKING, Any
|
||||||
JinaChat,
|
|
||||||
)
|
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__ = [
|
__all__ = [
|
||||||
"JinaChat",
|
"JinaChat",
|
||||||
|
@ -1,5 +1,23 @@
|
|||||||
from langchain_community.chat_models.konko import (
|
from typing import TYPE_CHECKING, Any
|
||||||
ChatKonko,
|
|
||||||
)
|
|
||||||
|
|
||||||
__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 (
|
from typing import TYPE_CHECKING, Any
|
||||||
convert_messages_to_prompt_llama,
|
|
||||||
)
|
|
||||||
|
|
||||||
__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 (
|
from typing import TYPE_CHECKING, Any
|
||||||
MiniMaxChat,
|
|
||||||
)
|
|
||||||
|
|
||||||
__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 typing import TYPE_CHECKING, Any
|
||||||
|
|
||||||
|
from langchain._api import create_importer
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
from langchain_community.chat_models.mlflow import ChatMlflow
|
from langchain_community.chat_models.mlflow import ChatMlflow
|
||||||
|
|
||||||
__all__ = ["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 typing import TYPE_CHECKING, Any
|
||||||
|
|
||||||
|
from langchain._api import create_importer
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
from langchain_community.chat_models.mlflow_ai_gateway import (
|
from langchain_community.chat_models.mlflow_ai_gateway import (
|
||||||
ChatMLflowAIGateway,
|
ChatMLflowAIGateway,
|
||||||
ChatParams,
|
ChatParams,
|
||||||
)
|
)
|
||||||
|
|
||||||
__all__ = ["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 (
|
from typing import TYPE_CHECKING, Any
|
||||||
ChatOllama,
|
|
||||||
)
|
|
||||||
|
|
||||||
__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 (
|
from typing import TYPE_CHECKING, Any
|
||||||
ChatOpenAI,
|
|
||||||
)
|
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__ = [
|
__all__ = [
|
||||||
"ChatOpenAI",
|
"ChatOpenAI",
|
||||||
|
@ -1,3 +1,25 @@
|
|||||||
|
from typing import TYPE_CHECKING, Any
|
||||||
|
|
||||||
|
from langchain._api import create_importer
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
from langchain_community.chat_models.pai_eas_endpoint import PaiEasChatEndpoint
|
from langchain_community.chat_models.pai_eas_endpoint import PaiEasChatEndpoint
|
||||||
|
|
||||||
__all__ = ["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 typing import TYPE_CHECKING, Any
|
||||||
|
|
||||||
|
from langchain._api import create_importer
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
from langchain_community.chat_models.promptlayer_openai import PromptLayerChatOpenAI
|
from langchain_community.chat_models.promptlayer_openai import PromptLayerChatOpenAI
|
||||||
|
|
||||||
__all__ = ["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 (
|
from typing import TYPE_CHECKING, Any
|
||||||
ChatTongyi,
|
|
||||||
)
|
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__ = [
|
__all__ = [
|
||||||
"ChatTongyi",
|
"ChatTongyi",
|
||||||
|
@ -1,6 +1,22 @@
|
|||||||
from langchain_community.chat_models.vertexai import (
|
from typing import TYPE_CHECKING, Any
|
||||||
ChatVertexAI,
|
|
||||||
)
|
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__ = [
|
__all__ = [
|
||||||
"ChatVertexAI",
|
"ChatVertexAI",
|
||||||
|
@ -1,6 +1,30 @@
|
|||||||
|
from typing import TYPE_CHECKING, Any
|
||||||
|
|
||||||
|
from langchain._api import create_importer
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
from langchain_community.chat_models.volcengine_maas import (
|
from langchain_community.chat_models.volcengine_maas import (
|
||||||
VolcEngineMaasChat,
|
VolcEngineMaasChat,
|
||||||
convert_dict_to_message,
|
convert_dict_to_message,
|
||||||
)
|
)
|
||||||
|
|
||||||
__all__ = ["convert_dict_to_message", "VolcEngineMaasChat"]
|
# 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 (
|
from typing import TYPE_CHECKING, Any
|
||||||
ChatYandexGPT,
|
|
||||||
)
|
|
||||||
|
|
||||||
__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…
Reference in New Issue
Block a user