@@ -61,23 +61,23 @@ def _define_custom_prompts() -> CustomPromptsDict:
61
61
"- If no preferred language is provided, answer in the same language as the language used by the user.\n "
62
62
"- You must use ONLY the provided context to answer the question. "
63
63
"Do not use any prior knowledge or external information, even if you are certain of the answer.\n "
64
- "- If you cannot provide an answer using ONLY the context provided, do not attempt to answer from your own knowledge."
65
- "Instead, inform the user that the answer isn't available in the context and suggest using the available tools {tools}.\n "
64
+ # "- If you cannot provide an answer using ONLY the context provided, do not attempt to answer from your own knowledge."
65
+ # "Instead, inform the user that the answer isn't available in the context and suggest using the available tools {tools}.\n"
66
66
"- Do not apologize when providing an answer.\n "
67
67
"- Don't cite the source id in the answer objects, but you can use the source to answer the question.\n \n "
68
68
)
69
69
70
70
context_template = (
71
71
"\n "
72
- "- You have access to the following internal reasoning to provide an answer: {reasoning}\n "
72
+ # "- You have access to the following internal reasoning to provide an answer: {reasoning}\n"
73
73
"- You have access to the following files to answer the user question (limited to first 20 files): {files}\n "
74
74
"- You have access to the following context to answer the user question: {context}\n "
75
75
"- Follow these user instruction when crafting the answer: {custom_instructions}\n "
76
76
"- These user instructions shall take priority over any other previous instruction.\n "
77
- "- Remember: if you cannot provide an answer using ONLY the provided context and CITING the sources, "
78
- "inform the user that you don't have the answer and consider if any of the tools can help answer the question.\n "
79
- "- Explain your reasoning about the potentiel tool usage in the answer.\n "
80
- "- Only use binded tools to answer the question.\n "
77
+ # "- Remember: if you cannot provide an answer using ONLY the provided context and CITING the sources, "
78
+ # "inform the user that you don't have the answer and consider if any of the tools can help answer the question.\n"
79
+ # "- Explain your reasoning about the potentiel tool usage in the answer.\n"
80
+ # "- Only use binded tools to answer the question.\n"
81
81
# "OFFER the user the possibility to ACTIVATE a relevant tool among "
82
82
# "the tools which can be activated."
83
83
# "Tools which can be activated: {tools}. If any of these tools can help in providing an answer "
@@ -88,6 +88,10 @@ def _define_custom_prompts() -> CustomPromptsDict:
88
88
template_answer = (
89
89
"Original task: {question}\n "
90
90
"Rephrased and contextualized task: {rephrased_task}\n "
91
+ "Remember, you shall answer ALL questions and tasks.\n "
92
+ "Remember: if you cannot provide an answer using ONLY the provided context and CITING the sources, "
93
+ "just answer that you don't have the answer.\n "
94
+ "If the provided context contains contradictory or conflicting information, state so providing the conflicting information.\n "
91
95
)
92
96
93
97
RAG_ANSWER_PROMPT = ChatPromptTemplate .from_messages (
@@ -207,8 +211,8 @@ def _define_custom_prompts() -> CustomPromptsDict:
207
211
"just reformulate them if needed and otherwise return them as is.\n "
208
212
"- Remember, you shall NOT suggest or generate new tasks.\n "
209
213
"- As an example, the user input 'What is Apple? Who is its CEO? When was it founded?' "
210
- "shall be split into the questions 'What is Apple?', 'Who is the CEO of Apple?' and 'When was Apple founded?'. \n "
211
- "- If no tasks are found, return the user input as is in the task.\n "
214
+ "shall be split into a list of tasks [ 'What is Apple?', 'Who is the CEO of Apple?', 'When was Apple founded?'] \n "
215
+ "- If no tasks are found, return the user input as is in the task list .\n "
212
216
)
213
217
214
218
template_answer = "User input: {user_input}"
0 commit comments