Skip to content
Discussion options

You must be logged in to vote

🤖

Hello,

Based on the issues you've described, it seems you want LangChain to not specify a document name when the answer to a question is not found within the provided documents, or to label the source as "Generic" for such responses.

There are similar issues that have been solved in the LangChain repository. For instance, the issue titled Agent answer questions that is not related to my custom data and Issue: Not answering questions out of context using RetrievalQA Chain and ConversationalChatAgent provide solutions to similar problems.

To achieve this, you can modify the FINAL ANSWER section of the template in the map_reduce_prompt.py file. Currently, when the answer is not found, the S…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by TheJokerBG
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant