langchainjs
langchainjs copied to clipboard
ChatOpenAI() isn't a BaseLLM and therefore cannot use in ConversationalRetrievalQAChain
I'm trying to use the ConversationalRetrievalQAChain with GPT3.5 because it's cheaper than GPT3.
But when I try to use new ChatOpenAI()
as the model for ConversationalRetrievalQAChain
it gives an error because it doesn't have the properties of name
and _generateUncached
that are present in BaseLLM
.
Is there anything I can do to resolve this for now?
const chatModel = new ChatOpenAI();
const chain = ConversationalRetrievalQAChain.fromLLM(
chatModel, // << TYPE ERROR
vectorStore.asRetriever(),
{ returnSourceDocuments: true }
);