The idea is:
In “Question and Answer Chain” node, add the ability to customize the Question-Answering — stuff default prompt.
When adding a retriever, such as the Vector Store Retriever, the following default prompt is used:
Use the following pieces of context to answer the users question.
If you don't know the answer, just say that you don't know, don't try to make up an answer.
----------------
{context}
We should be able to customize the prompt.
My use case:
I would like to customize the prompt, so I can better control the output of the llm model.
I think it would be beneficial to add this because:
There are many advanced applications of a custom prompt. You could add further system instructions for safety reasons, customize the format of the response, add further instructions for the response…
Also if your application is exclusively non-english, there’s no reason to use an english prompt.
Any resources to support this?
There’s a medium article that shows how to customize the prompt:
https://medium.com/the-data-perspectives/custom-prompts-for-langchain-chains-a780b490c199#1fc4
Here’s where the default prompt is defined on the langchain source code:
Are you willing to work on this?
Sure