gpt4-pdf-chatbot-langchain icon indicating copy to clipboard operation
gpt4-pdf-chatbot-langchain copied to clipboard

Get Responses Outside the document

Open disocodes opened this issue 2 years ago • 3 comments

Thank you for the project, I tested it out with a different document and it worked well with a few mismatches. However how can I make the chatbot respond to questions out of the document as I have asked the bot simple questions like "Hi Chatbot, I have a question" and it start to hallucinate answers from the extracted parts. I have tried reading lanchain's documentation but cant work my way around. Is there a way to have chatbot engage in general conversations as guided by another prompt but then once a specific question relates to the extracted parts the bot then attempts to get answer from the document?

disocodes avatar Apr 03 '23 03:04 disocodes

I think you need to change QA_PROMPT and remove lines where chagpt is asked to not provide info outside of context.

dmitrii-brand avatar Apr 03 '23 04:04 dmitrii-brand

Hey dmitri-brand, I have tried playing around with the prompts but all conversations seem to be focusing on the documents, it looks like loadQAChain function can only read from the vector store. It would be great if the chatbot can do both have converstaion out of context and still get responses from the extracted parts when asked about the documenation. I sure your senior coders can easily find you way arround this.

disocodes avatar Apr 03 '23 07:04 disocodes

I would also be interested in this feature. Did anyone figure out a way? one way that I tried to go about this was to check if the response has a string of "Hmm" since this is the default response for not finding the answer and then construct a conversationChain

Lionardo avatar Apr 04 '23 10:04 Lionardo

Hi, @disocodes! I'm Dosu, and I'm helping the gpt4-pdf-chatbot-langchain team manage their backlog. I wanted to let you know that we are marking this issue as stale.

From what I understand, the issue is about making the chatbot respond to questions outside of the document. There have been suggestions to change the QA_PROMPT and remove lines that restrict the chatbot from providing information outside of the context. Another user also tried constructing a conversationChain by checking if the response has a string of "Hmm", which is the default response for not finding the answer.

Before we close this issue, we wanted to check with you if it is still relevant to the latest version of the gpt4-pdf-chatbot-langchain repository. If it is, please let us know by commenting on the issue. Otherwise, feel free to close the issue yourself, or it will be automatically closed in 7 days.

Thank you for your understanding and contributions to the project!

dosubot[bot] avatar Sep 23 '23 16:09 dosubot[bot]