export const makeChain = (vectorstore: PineconeStore) => { | |
const model = new OpenAI({ | |
temperature: 0, | |
modelName: 'gpt-4' | |
}); | |
const chain = ConversationalRetrievalQAChain.fromLLM( | |
model, | |
vectorstore.asRetriever(), | |
{ | |
qaTemplate: QA_PROMPT, | |
questionGeneratorTemplate: CONDENSE_PROMPT, | |
returnSourceDocuments: true | |
}, | |
); | |
return chain; | |
}; |