mirror of
https://github.com/hwchase17/langchain.git
synced 2025-05-18 13:31:36 +00:00
- **Description:** - This PR introduces a significant enhancement to the LangChain project by integrating a new chat model powered by the third-generation base large model, ChatGLM3, via the zhipuai API. - This advanced model supports functionalities like function calls, code interpretation, and intelligent Agent capabilities. - The additions include the chat model itself, comprehensive documentation in the form of Python notebook docs, and thorough testing with both unit and integrated tests. - **Dependencies:** This update relies on the ZhipuAI package as a key dependency. - **Twitter handle:** If this PR receives spotlight attention, we would be honored to receive a mention for our integration of the advanced ChatGLM3 model via the ZhipuAI API. Kindly tag us at @kaiwu. To ensure quality and standards, we have performed extensive linting and testing. Commands such as make format, make lint, and make test have been run from the root of the modified package to ensure compliance with LangChain's coding standards. TO DO: Continue refining and enhancing both the unit tests and integrated tests. --------- Co-authored-by: jing <jingguo92@gmail.com> Co-authored-by: hyy1987 <779003812@qq.com> Co-authored-by: jianchuanqi <qijianchuan@hotmail.com> Co-authored-by: lirq <whuclarence@gmail.com> Co-authored-by: whucalrence <81530213+whucalrence@users.noreply.github.com> Co-authored-by: Jing Guo <48378126+JaneCrystall@users.noreply.github.com>
91 lines
3.5 KiB
Python
91 lines
3.5 KiB
Python
"""**Chat Models** are a variation on language models.
|
|
|
|
While Chat Models use language models under the hood, the interface they expose
|
|
is a bit different. Rather than expose a "text in, text out" API, they expose
|
|
an interface where "chat messages" are the inputs and outputs.
|
|
|
|
**Class hierarchy:**
|
|
|
|
.. code-block::
|
|
|
|
BaseLanguageModel --> BaseChatModel --> <name> # Examples: ChatOpenAI, ChatGooglePalm
|
|
|
|
**Main helpers:**
|
|
|
|
.. code-block::
|
|
|
|
AIMessage, BaseMessage, HumanMessage
|
|
""" # noqa: E501
|
|
|
|
from langchain_community.chat_models.anthropic import ChatAnthropic
|
|
from langchain_community.chat_models.anyscale import ChatAnyscale
|
|
from langchain_community.chat_models.azure_openai import AzureChatOpenAI
|
|
from langchain_community.chat_models.baichuan import ChatBaichuan
|
|
from langchain_community.chat_models.baidu_qianfan_endpoint import QianfanChatEndpoint
|
|
from langchain_community.chat_models.bedrock import BedrockChat
|
|
from langchain_community.chat_models.cohere import ChatCohere
|
|
from langchain_community.chat_models.databricks import ChatDatabricks
|
|
from langchain_community.chat_models.ernie import ErnieBotChat
|
|
from langchain_community.chat_models.everlyai import ChatEverlyAI
|
|
from langchain_community.chat_models.fake import FakeListChatModel
|
|
from langchain_community.chat_models.fireworks import ChatFireworks
|
|
from langchain_community.chat_models.gigachat import GigaChat
|
|
from langchain_community.chat_models.google_palm import ChatGooglePalm
|
|
from langchain_community.chat_models.gpt_router import GPTRouter
|
|
from langchain_community.chat_models.huggingface import ChatHuggingFace
|
|
from langchain_community.chat_models.human import HumanInputChatModel
|
|
from langchain_community.chat_models.hunyuan import ChatHunyuan
|
|
from langchain_community.chat_models.javelin_ai_gateway import ChatJavelinAIGateway
|
|
from langchain_community.chat_models.jinachat import JinaChat
|
|
from langchain_community.chat_models.konko import ChatKonko
|
|
from langchain_community.chat_models.litellm import ChatLiteLLM
|
|
from langchain_community.chat_models.minimax import MiniMaxChat
|
|
from langchain_community.chat_models.mlflow import ChatMlflow
|
|
from langchain_community.chat_models.mlflow_ai_gateway import ChatMLflowAIGateway
|
|
from langchain_community.chat_models.ollama import ChatOllama
|
|
from langchain_community.chat_models.openai import ChatOpenAI
|
|
from langchain_community.chat_models.pai_eas_endpoint import PaiEasChatEndpoint
|
|
from langchain_community.chat_models.promptlayer_openai import PromptLayerChatOpenAI
|
|
from langchain_community.chat_models.tongyi import ChatTongyi
|
|
from langchain_community.chat_models.vertexai import ChatVertexAI
|
|
from langchain_community.chat_models.volcengine_maas import VolcEngineMaasChat
|
|
from langchain_community.chat_models.yandex import ChatYandexGPT
|
|
from langchain_community.chat_models.zhipuai import ChatZhipuAI
|
|
|
|
__all__ = [
|
|
"ChatOpenAI",
|
|
"BedrockChat",
|
|
"AzureChatOpenAI",
|
|
"FakeListChatModel",
|
|
"PromptLayerChatOpenAI",
|
|
"ChatDatabricks",
|
|
"ChatEverlyAI",
|
|
"ChatAnthropic",
|
|
"ChatCohere",
|
|
"ChatGooglePalm",
|
|
"ChatMlflow",
|
|
"ChatMLflowAIGateway",
|
|
"ChatOllama",
|
|
"ChatVertexAI",
|
|
"JinaChat",
|
|
"ChatHuggingFace",
|
|
"HumanInputChatModel",
|
|
"MiniMaxChat",
|
|
"ChatAnyscale",
|
|
"ChatLiteLLM",
|
|
"ErnieBotChat",
|
|
"ChatJavelinAIGateway",
|
|
"ChatKonko",
|
|
"PaiEasChatEndpoint",
|
|
"QianfanChatEndpoint",
|
|
"ChatTongyi",
|
|
"ChatFireworks",
|
|
"ChatYandexGPT",
|
|
"ChatBaichuan",
|
|
"ChatHunyuan",
|
|
"GigaChat",
|
|
"VolcEngineMaasChat",
|
|
"GPTRouter",
|
|
"ChatZhipuAI",
|
|
]
|