ErnieBotChat()ERNIE-Bot large language model.
ERNIE-Bot is a large language model developed by Baidu, covering a huge amount of Chinese data.
To use, you should have the ernie_client_id and ernie_client_secret set,
or set the environment variable ERNIE_CLIENT_ID and ERNIE_CLIENT_SECRET.
Note: access_token will be automatically generated based on client_id and client_secret, and will be regenerated after expiration (30 days).
Default model is ERNIE-Bot-turbo,
currently supported models are ERNIE-Bot-turbo, ERNIE-Bot, ERNIE-Bot-8K,
ERNIE-Bot-4, ERNIE-Bot-turbo-AI.
Example:
.. code-block:: python
from langchain_community.chat_models import ErnieBotChat chat = ErnieBotChat(model_name='ERNIE-Bot')
Deprecated Note:
Please use QianfanChatEndpoint instead of this class.
QianfanChatEndpoint is a more suitable choice for production.
Always test your code after changing to QianfanChatEndpoint.
Example of QianfanChatEndpoint:
.. code-block:: python
from langchain_community.chat_models import QianfanChatEndpoint
qianfan_chat = QianfanChatEndpoint(model="ERNIE-Bot",
endpoint="your_endpoint", qianfan_ak="your_ak", qianfan_sk="your_sk")