Skip to content

Instantly share code, notes, and snippets.

@Juraj-Sulimanovic
Created April 5, 2024 10:38
Show Gist options
  • Save Juraj-Sulimanovic/d80321e78e9ef95458e9384f4571deb0 to your computer and use it in GitHub Desktop.
Save Juraj-Sulimanovic/d80321e78e9ef95458e9384f4571deb0 to your computer and use it in GitHub Desktop.
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;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment