Skip to main content

Setup

You’ll first need to install the @langchain/baidu-qianfan package:
npm
Available models: ERNIE-Bot,ERNIE-Lite-8K,ERNIE-Bot-4,ERNIE-Speed-8K,ERNIE-Speed-128K,ERNIE-4.0-8K, ERNIE-4.0-8K-Preview,ERNIE-3.5-8K,ERNIE-3.5-8K-Preview,ERNIE-Lite-8K,ERNIE-Tiny-8K,ERNIE-Character-8K, ERNIE Speed-AppBuilder Abandoned models: ERNIE-Bot-turbo

Usage

Streaming

Qianfan’s API also supports streaming token responses. The example below demonstrates how to use this feature.