Files
langchain/docs/extras/integrations/chat/ernie.ipynb
T
axiangcoding 63601551b1 fix(llms): improve the ernie chat model (#9289)
- Description: improve the ernie chat model.
   - fix missing kwargs to payload
   - new test cases
   - add some debug level log
   - improve description
- Issue: None
- Dependencies: None
- Tag maintainer: @baskaryan
2023-08-16 00:48:42 -07:00

2.1 KiB

ERNIE-Bot Chat

ERNIE-Bot is a large language model developed by Baidu, covering a huge amount of Chinese data. This notebook covers how to get started with ErnieBot chat models.

In [7]:
from langchain.chat_models import ErnieBotChat
from langchain.schema import HumanMessage
In [13]:
chat = ErnieBotChat(ernie_client_id='YOUR_CLIENT_ID', ernie_client_secret='YOUR_CLIENT_SECRET')

or you can set client_id and client_secret in your environment variables

export ERNIE_CLIENT_ID=YOUR_CLIENT_ID
export ERNIE_CLIENT_SECRET=YOUR_CLIENT_SECRET
In [15]:
chat([
    HumanMessage(content='hello there, who are you?')
])
Out [15]:
AIMessage(content='Hello, I am an artificial intelligence language model. My purpose is to help users answer questions or provide information. What can I do for you?', additional_kwargs={}, example=False)