ConversationalRetrievalQAChain answering general questions #1120
-
I am using a My workaround looks pretty ugly at the moment, any body can point me to the right way to achieve this?
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I think the right way to do it is to define a custom qaTemplate like so: const QA_PROMPT = PromptTemplate.fromTemplate( Question: {question} then you can overwrite the default prompt by setting you can customize the template to your needs ofc, but should contain basic instructions for the model to fullfill your task correctly |
Beta Was this translation helpful? Give feedback.
I think the right way to do it is to define a custom qaTemplate like so:
const QA_PROMPT = PromptTemplate.fromTemplate(
`You are an AI assistant providing helpful advice. You are given the following extracted parts of a long document and a question. Provide a conversational answer based on the context provided.
You should only provide hyperlinks that reference the context below. Do NOT make up hyperlinks.
If you can't find the answer in the context below, just say "The document does not provide information to answer your question." Don't try to make up an answer.
If the question is not related to the context, politely respond that you are tuned to only answer questions that are related to…