@@ -27,28 +27,28 @@ def _define_custom_prompts() -> CustomPromptsDict:
27
27
today_date = datetime .datetime .now ().strftime ("%B %d, %Y" )
28
28
29
29
# ---------------------------------------------------------------------------
30
- # Prompt for question rephrasing
30
+ # Prompt for task rephrasing
31
31
# ---------------------------------------------------------------------------
32
32
system_message_template = (
33
- "Given a chat history and the latest user question "
33
+ "Given a chat history and the latest user task "
34
34
"which might reference context in the chat history, "
35
- "formulate a standalone question which can be understood "
36
- "without the chat history. Do NOT answer the question , "
35
+ "formulate a standalone task which can be understood "
36
+ "without the chat history. Do NOT complete the task , "
37
37
"just reformulate it if needed and otherwise return it as is. "
38
- "Do not output your reasoning, just the question ."
38
+ "Do not output your reasoning, just the task ."
39
39
)
40
40
41
- template_answer = "User question : {question }\n Standalone question :"
41
+ template_answer = "User task : {task }\n Standalone task :"
42
42
43
- CONDENSE_QUESTION_PROMPT = ChatPromptTemplate .from_messages (
43
+ CONDENSE_TASK_PROMPT = ChatPromptTemplate .from_messages (
44
44
[
45
45
SystemMessagePromptTemplate .from_template (system_message_template ),
46
46
MessagesPlaceholder (variable_name = "chat_history" ),
47
47
HumanMessagePromptTemplate .from_template (template_answer ),
48
48
]
49
49
)
50
50
51
- custom_prompts ["CONDENSE_QUESTION_PROMPT " ] = CONDENSE_QUESTION_PROMPT
51
+ custom_prompts ["CONDENSE_TASK_PROMPT " ] = CONDENSE_TASK_PROMPT
52
52
53
53
# ---------------------------------------------------------------------------
54
54
# Prompt for RAG
@@ -59,19 +59,19 @@ def _define_custom_prompts() -> CustomPromptsDict:
59
59
"- When answering use markdown. Use markdown code blocks for code snippets.\n "
60
60
"- Answer in a concise and clear manner.\n "
61
61
"- If no preferred language is provided, answer in the same language as the language used by the user.\n "
62
- "- You must use ONLY the provided context to answer the question . "
62
+ "- You must use ONLY the provided context to complete the task . "
63
63
"Do not use any prior knowledge or external information, even if you are certain of the answer.\n "
64
64
# "- If you cannot provide an answer using ONLY the context provided, do not attempt to answer from your own knowledge."
65
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
- "- Don't cite the source id in the answer objects, but you can use the source to answer the question .\n \n "
67
+ "- Don't cite the source id in the answer objects, but you can use the source to complete the task .\n \n "
68
68
)
69
69
70
70
context_template = (
71
71
"\n "
72
72
# "- You have access to the following internal reasoning to provide an answer: {reasoning}\n"
73
- "- You have access to the following files to answer the user question (limited to first 20 files): {files}\n "
74
- "- You have access to the following context to answer the user question : {context}\n "
73
+ "- You have access to the following files to complete the task (limited to first 20 files): {files}\n "
74
+ "- You have access to the following context to complete the task : {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
77
# "- Remember: if you cannot provide an answer using ONLY the provided context and CITING the sources, "
@@ -86,9 +86,9 @@ def _define_custom_prompts() -> CustomPromptsDict:
86
86
)
87
87
88
88
template_answer = (
89
- "Original task: {question }\n "
89
+ "Original task: {task }\n "
90
90
"Rephrased and contextualized task: {rephrased_task}\n "
91
- "Remember, you shall answer ALL questions and tasks.\n "
91
+ "Remember, you shall complete ALL tasks.\n "
92
92
"Remember: if you cannot provide an answer using ONLY the provided context and CITING the sources, "
93
93
"just answer that you don't have the answer.\n "
94
94
"If the provided context contains contradictory or conflicting information, state so providing the conflicting information.\n "
@@ -123,7 +123,7 @@ def _define_custom_prompts() -> CustomPromptsDict:
123
123
"""
124
124
125
125
template_answer = """
126
- User Question : {question }
126
+ User Task : {task }
127
127
Answer:
128
128
"""
129
129
CHAT_LLM_PROMPT = ChatPromptTemplate .from_messages (
@@ -141,15 +141,15 @@ def _define_custom_prompts() -> CustomPromptsDict:
141
141
system_message_template = (
142
142
"Given the following user input, determine the user intent, in particular "
143
143
"whether the user is providing instructions to the system or is asking the system to "
144
- "execute a task:\n "
144
+ "complete a task:\n "
145
145
" - if the user is providing direct instructions to modify the system behaviour (for instance, "
146
146
"'Can you reply in French?' or 'Answer in French' or 'You are an expert legal assistant' "
147
147
"or 'You will behave as...'), the user intent is 'prompt';\n "
148
148
" - in all other cases (asking questions, asking for summarising a text, asking for translating a text, ...), "
149
149
"the intent is 'task'.\n "
150
150
)
151
151
152
- template_answer = "User input: {question }"
152
+ template_answer = "User input: {task }"
153
153
154
154
USER_INTENT_PROMPT = ChatPromptTemplate .from_messages (
155
155
[
0 commit comments