Why ConversationalRetrievalChain only answer questions related RAG document and lost original model answering capability #25666
Replies: 1 comment
-
Hello @kunZooberg! I'm here to help you with any bugs, questions, and contributing needs. Let's tackle this issue together! The Here's an example of how the prompt is structured: prompt = ChatPromptTemplate.from_messages(
[
(
"system",
"You are an AI assistant. Answer based on the retrieved documents:"
"\n<Documents>\n{context}\n</Documents>",
),
("user", "{question}?"),
]
) This prompt tells the model to base its answers on the retrieved documents, thereby limiting its ability to answer questions outside of the provided context. Additionally, the |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Checked other resources
Commit to Help
Example Code
Description
I am learing RAG + langchain, and write this code, found it only can anwser question related RAG documents. if the anwser is not related, it will print "Assistant: I'm sorry, but I don't have the answer to that question.", but I configured it with chatgpt3.5, what coult be the problem?
System Info
langchain==0.2.14
langchain-anthropic==0.1.23
langchain-chroma==0.1.3
langchain-community==0.2.12
langchain-core==0.2.34
langchain-huggingface==0.0.3
langchain-openai==0.1.22
langchain-text-splitters==0.2.2
platform mac
python 3.12.5
System Information
Package Information
Optional packages not installed
Other Dependencies
Beta Was this translation helpful? Give feedback.
All reactions