Stream HelpersLangChainStream

LangChainStream

Helps with the integration of LangChain. It is compatible with useChat and useCompletion.

Import

React

import { LangChainStream } from "ai"

Parameter

callbacks:

AIStreamCallbacks

Response Object

stream:

ReadableStream
This is the readable stream that can be piped into another stream. This stream contains the results of the LangChain process.

handlers:

LangChainCallbacks
This object contains handlers that can be used to handle certain callbacks provided by LangChain.