Install and import from @langchain/baidu-qianfan instead. Wrapper around Baidu ERNIE large language models that use the Chat endpoint.
To use you should have the BAIDU_API_KEY and BAIDU_SECRET_KEY environment variable set.
BAIDU_API_KEY
BAIDU_SECRET_KEY
const ernieTurbo = new ChatBaiduWenxin({ apiKey: "YOUR-API-KEY", baiduSecretKey: "YOUR-SECRET-KEY",});const ernie = new ChatBaiduWenxin({ model: "ERNIE-Bot", temperature: 1, apiKey: "YOUR-API-KEY", baiduSecretKey: "YOUR-SECRET-KEY",});const messages = [new HumanMessage("Hello")];let res = await ernieTurbo.call(messages);res = await ernie.call(messages); Copy
const ernieTurbo = new ChatBaiduWenxin({ apiKey: "YOUR-API-KEY", baiduSecretKey: "YOUR-SECRET-KEY",});const ernie = new ChatBaiduWenxin({ model: "ERNIE-Bot", temperature: 1, apiKey: "YOUR-API-KEY", baiduSecretKey: "YOUR-SECRET-KEY",});const messages = [new HumanMessage("Hello")];let res = await ernieTurbo.call(messages);res = await ernie.call(messages);
Optional
Deprecated
Install and import from @langchain/baidu-qianfan instead. Wrapper around Baidu ERNIE large language models that use the Chat endpoint.
To use you should have the
BAIDU_API_KEY
andBAIDU_SECRET_KEY
environment variable set.Example