codekingpro/portable-devtools
114k
1"""**Chat Models** are a variation on language models.2 3While Chat Models use language models under the hood, the interface they expose4is a bit different. Rather than expose a "text in, text out" API, they expose5an interface where "chat messages" are the inputs and outputs.6"""7 8import warnings9 10from langchain_core._api import LangChainDeprecationWarning11 12from langchain_classic._api.interactive_env import is_interactive_env13from langchain_classic.chat_models.base import init_chat_model14 15 16def __getattr__(name: str) -> None:17 from langchain_community import chat_models18 19 # If not in interactive env, raise warning.20 if not is_interactive_env():21 warnings.warn(22 "Importing chat models from langchain is deprecated. Importing from "23 "langchain will no longer be supported as of langchain==0.2.0. "24 "Please import from langchain-community instead:\n\n"25 f"`from langchain_community.chat_models import {name}`.\n\n"26 "To install langchain-community run `pip install -U langchain-community`.",27 stacklevel=2,28 category=LangChainDeprecationWarning,29 )30 31 return getattr(chat_models, name)32 33 34__all__ = [35 "AzureChatOpenAI",36 "BedrockChat",37 "ChatAnthropic",38 "ChatAnyscale",39 "ChatBaichuan",40 "ChatCohere",41 "ChatDatabricks",42 "ChatEverlyAI",43 "ChatFireworks",44 "ChatGooglePalm",45 "ChatHunyuan",46 "ChatJavelinAIGateway",47 "ChatKonko",48 "ChatLiteLLM",49 "ChatMLflowAIGateway",50 "ChatMlflow",51 "ChatOllama",52 "ChatOpenAI",53 "ChatVertexAI",54 "ChatYandexGPT",55 "ErnieBotChat",56 "FakeListChatModel",57 "GigaChat",58 "HumanInputChatModel",59 "JinaChat",60 "MiniMaxChat",61 "PaiEasChatEndpoint",62 "PromptLayerChatOpenAI",63 "QianfanChatEndpoint",64 "VolcEngineMaasChat",65 "init_chat_model",66]67 