Update app.py
Browse files
app.py
CHANGED
@@ -79,31 +79,13 @@ llm = ChatOpenAI(
|
|
79 |
)
|
80 |
|
81 |
# Create prompt template
|
82 |
-
template =
|
83 |
-
You are an expert assistant specializing in the Mawared HR System. Your task is to
|
84 |
-
|
85 |
-
To improve your responses, follow these steps:
|
86 |
-
|
87 |
-
Chain-of-Thought (COT): Break down complex queries into logical steps. Use tags like [Step 1], [Step 2], etc., to label each part of the reasoning process. This helps structure your thinking and ensure clarity. For example:
|
88 |
-
|
89 |
-
[Step 1] Identify the key details in the context relevant to the question.
|
90 |
-
[Step 2] Break down any assumptions or information gaps.
|
91 |
-
[Step 3] Combine all pieces to form the final, well-reasoned response.
|
92 |
-
Reasoning: Demonstrate a clear logical connection between the context and your answer at each step. If information is missing or unclear, indicate the gap using tags like [Missing Information] and ask relevant follow-up questions to fill that gap.
|
93 |
-
|
94 |
-
Clarity and Precision: Provide direct, concise answers focused only on the context. Avoid including speculative or unrelated information.
|
95 |
-
|
96 |
-
Follow-up Questions: If the context is insufficient, focus on asking specific, relevant questions. Label them as [Clarifying Question] to indicate they are needed to complete the response. For example:
|
97 |
-
|
98 |
-
[Clarifying Question] Could you specify which employee section you're referring to?
|
99 |
Context:
|
100 |
{context}
|
101 |
-
|
102 |
Question:
|
103 |
{question}
|
104 |
-
|
105 |
-
|
106 |
-
Answer
|
107 |
"""
|
108 |
|
109 |
prompt = ChatPromptTemplate.from_template(template)
|
|
|
79 |
)
|
80 |
|
81 |
# Create prompt template
|
82 |
+
template = """
|
83 |
+
You are an expert assistant specializing in the Mawared HR System. Your task is to provide accurate and contextually relevant answers strictly based on the provided context. If the context lacks sufficient information, ask targeted clarifying questions to gather specific details required for a precise response. Always ensure clarity, brevity, and relevance in your answers.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
84 |
Context:
|
85 |
{context}
|
|
|
86 |
Question:
|
87 |
{question}
|
88 |
+
Answer:
|
|
|
|
|
89 |
"""
|
90 |
|
91 |
prompt = ChatPromptTemplate.from_template(template)
|