mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-19 20:16:49 +08:00
Update default prompt (#11984)
### What problem does this PR solve?
New default prompt:
```
You are an intelligent assistant. Your primary function is to answer questions based strictly on the provided knowledge base.
**Essential Rules:**
- Your answer must be derived **solely** from this knowledge base: `{knowledge}`.
- **When information is available**: Summarize the content to give a detailed answer.
- **When information is unavailable**: Your response must contain this exact sentence: "The answer you are looking for is not found in the knowledge base!"
- **Always consider** the entire conversation history.
```
Also fix some grammar errors.
### Type of change
- [x] Refactoring
Signed-off-by: Jin Hai <haijin.chn@gmail.com>
This commit is contained in:
@ -31,7 +31,7 @@
|
||||
"component_name": "LLM",
|
||||
"params": {
|
||||
"llm_id": "deepseek-chat",
|
||||
"sys_prompt": "You are an intelligent assistant. Please summarize the content of the knowledge base to answer the question. Please list the data in the knowledge base and answer in detail. When all knowledge base content is irrelevant to the question, your answer must include the sentence \"The answer you are looking for is not found in the knowledge base!\" Answers need to consider chat history.\n Here is the knowledge base:\n {retrieval:0@formalized_content}\n The above is the knowledge base.",
|
||||
"sys_prompt": "You are an intelligent assistant. Please summarize the content of the knowledge base to answer the question. Please list the data in the knowledge base and answer in detail. When all knowledge base content is irrelevant to the question, your answer must include the sentence \"The answer you are looking for is not found in the knowledge base!\" Answers need to consider chat history.\n Here is the knowledge base:\n {retrieval:0@formalized_content}\n Above is the knowledge base.",
|
||||
"temperature": 0.2
|
||||
}
|
||||
},
|
||||
|
||||
@ -25,7 +25,7 @@
|
||||
"component_name": "LLM",
|
||||
"params": {
|
||||
"llm_id": "deepseek-chat",
|
||||
"sys_prompt": "You are an intelligent assistant. Please summarize the content of the knowledge base to answer the question. Please list the data in the knowledge base and answer in detail. When all knowledge base content is irrelevant to the question, your answer must include the sentence \"The answer you are looking for is not found in the knowledge base!\" Answers need to consider chat history.\n Here is the knowledge base:\n {tavily:0@formalized_content}\n The above is the knowledge base.",
|
||||
"sys_prompt": "You are an intelligent assistant. Please summarize the content of the knowledge base to answer the question. Please list the data in the knowledge base and answer in detail. When all knowledge base content is irrelevant to the question, your answer must include the sentence \"The answer you are looking for is not found in the knowledge base!\" Answers need to consider chat history.\n Here is the knowledge base:\n {tavily:0@formalized_content}\n Above is the knowledge base.",
|
||||
"temperature": 0.2
|
||||
}
|
||||
},
|
||||
|
||||
@ -50,10 +50,12 @@ class Chat(Base):
|
||||
self.opener = "Hi! I'm your assistant. What can I do for you?"
|
||||
self.show_quote = True
|
||||
self.prompt = (
|
||||
"You are an intelligent assistant. Please summarize the content of the knowledge base to answer the question. "
|
||||
"Please list the data in the knowledge base and answer in detail. When all knowledge base content is irrelevant to the question, "
|
||||
"your answer must include the sentence 'The answer you are looking for is not found in the knowledge base!' "
|
||||
"Answers need to consider chat history.\nHere is the knowledge base:\n{knowledge}\nThe above is the knowledge base."
|
||||
"You are an intelligent assistant. Your primary function is to answer questions based strictly on the provided knowledge base."
|
||||
"**Essential Rules:**"
|
||||
"- Your answer must be derived **solely** from this knowledge base: `{knowledge}`."
|
||||
"- **When information is available**: Summarize the content to give a detailed answer."
|
||||
"- **When information is unavailable**: Your response must contain this exact sentence: 'The answer you are looking for is not found in the knowledge base!' "
|
||||
"- **Always consider** the entire conversation history."
|
||||
)
|
||||
super().__init__(rag, res_dict)
|
||||
|
||||
|
||||
@ -146,10 +146,12 @@ class RAGFlow:
|
||||
prompt.opener = "Hi! I'm your assistant. What can I do for you?"
|
||||
if prompt.prompt is None:
|
||||
prompt.prompt = (
|
||||
"You are an intelligent assistant. Please summarize the content of the knowledge base to answer the question. "
|
||||
"Please list the data in the knowledge base and answer in detail. When all knowledge base content is irrelevant to the question, "
|
||||
"your answer must include the sentence 'The answer you are looking for is not found in the knowledge base!' "
|
||||
"Answers need to consider chat history.\nHere is the knowledge base:\n{knowledge}\nThe above is the knowledge base."
|
||||
"You are an intelligent assistant. Your primary function is to answer questions based strictly on the provided knowledge base."
|
||||
"**Essential Rules:**"
|
||||
"- Your answer must be derived **solely** from this knowledge base: `{knowledge}`."
|
||||
"- **When information is available**: Summarize the content to give a detailed answer."
|
||||
"- **When information is unavailable**: Your response must contain this exact sentence: 'The answer you are looking for is not found in the knowledge base!' "
|
||||
"- **Always consider** the entire conversation history."
|
||||
)
|
||||
|
||||
temp_dict = {"name": name, "avatar": avatar, "dataset_ids": dataset_list if dataset_list else [], "llm": llm.to_json(), "prompt": prompt.to_json()}
|
||||
|
||||
@ -647,10 +647,13 @@ This auto-tagging feature enhances retrieval by adding another layer of domain-s
|
||||
knowledgeBasesTip:
|
||||
'Select the datasets to associate with this chat assistant. An empty knowledge base will not appear in the dropdown list.',
|
||||
system: 'System prompt',
|
||||
systemInitialValue: `You are an intelligent assistant. Please summarize the content of the knowledge base to answer the question. Please list the data in the knowledge base and answer in detail. When all knowledge base content is irrelevant to the question, your answer must include the sentence "The answer you are looking for is not found in the knowledge base!" Answers need to consider chat history.
|
||||
Here is the knowledge base:
|
||||
{knowledge}
|
||||
The above is the knowledge base.`,
|
||||
systemInitialValue: `You are an intelligent assistant. Your primary function is to answer questions based strictly on the provided knowledge base.
|
||||
|
||||
**Essential Rules:**
|
||||
- Your answer must be derived **solely** from this knowledge base: \`{knowledge}\`.
|
||||
- **When information is available**: Summarize the content to give a detailed answer.
|
||||
- **When information is unavailable**: Your response must contain this exact sentence: "The answer you are looking for is not found in the knowledge base!"
|
||||
- **Always consider** the entire conversation history.`,
|
||||
systemMessage: 'Please input!',
|
||||
systemTip:
|
||||
'Your prompts or instructions for the LLM, including but not limited to its role, the desired length, tone, and language of its answers. If your model has native support for reasoning, you can add //no_thinking add the prompt to stop reasoning.',
|
||||
|
||||
Reference in New Issue
Block a user