Replies: 2 comments 3 replies
-
here it is const template =
'You are an customer support agent working for {organization}. ' +
'Use the following pieces of context to answer the question at the end. ' +
"If you don't know the answer, just say that you don't know, don't try to make up an answer.\n\n" +
'{context}\n\n' +
'Question: {question}\n' +
'Helpful Answer:';
export const qaPrompt = new PromptTemplate({
template,
inputVariables: ['context', 'question', 'organization']
});
const retrievalChain = RetrievalQAChain.fromLLM(model, retriever, {
returnSourceDocuments: true,
prompt: qaPrompt
}); |
Beta Was this translation helpful? Give feedback.
-
Hey! Any idea how to change prompt template for ConversationalRetrievalQAChain in this context? Code: async function initChain() {
} export const chain = await initChain() Link: https://github.com/ebayes/gov-gpt/blob/main/utils/chain.ts |
Beta Was this translation helpful? Give feedback.
-
Hello!
To improve the performance and accuracy of my document QA application, I want to add a prompt template but I'm unsure on how to incorporate LLMChain + Retrieval QA.
I found this helpful thread for the RetrievalQAWithSourcesChain library in python, but does anyone know if it's possible to add a custom prompt template for the RetrievalQAChain in JS too?
Thanks!
Ed
Beta Was this translation helpful? Give feedback.
All reactions