langchainjs
langchainjs copied to clipboard
Stream ConversationalRetrievalQAChain is not working
I'm using a pinecone vector with OpenAIChat model in a ConversationalRetrievalQAChain, it works as intended when im not streaming the output however if I change the OpenAIChat to streaming true as per the below code snippet it fails with the following error "TypeError: stream.getReader is not a function"
const model = new OpenAIChat({
streaming: true,
callbackManager: CallbackManager.fromHandlers({
async handleLLMNewToken(token: string) {
console.log(token);
},
}),
});
This is in a nextjs API route