Spaces:
Running
Running
Update alz_companion/prompts.py
Browse files- alz_companion/prompts.py +34 -0
alz_companion/prompts.py
CHANGED
|
@@ -420,6 +420,40 @@ Your response MUST be based ONLY on the information in the 'General Guidance' an
|
|
| 420 |
5. **CRITICAL:** Do not include any preambles, headings, or labels like "My response is...". Address the user directly and naturally.
|
| 421 |
"""
|
| 422 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 423 |
|
| 424 |
# In prompts.py, replace the old ANSWER_TEMPLATE_ADQ with this revised version:
|
| 425 |
# TMP relabel ANSWER_TEMPLATE_ADQ to ANSWER_TEMPLATE_ADQ_caregiver
|
|
|
|
| 420 |
5. **CRITICAL:** Do not include any preambles, headings, or labels like "My response is...". Address the user directly and naturally.
|
| 421 |
"""
|
| 422 |
|
| 423 |
+
ANSWER_TEMPLATE_ADQ = """--- General Guidance from Knowledge Base ---
|
| 424 |
+
{general_context}
|
| 425 |
+
--- Relevant Personal Memories ---
|
| 426 |
+
{personal_context}
|
| 427 |
+
---
|
| 428 |
+
<PARTICIPANTS>
|
| 429 |
+
- Patient's Name: {patient_name}
|
| 430 |
+
- Caregiver's Name: {caregiver_name}
|
| 431 |
+
- Your Role: You are speaking to the {role}.
|
| 432 |
+
</PARTICIPANTS>
|
| 433 |
+
---
|
| 434 |
+
User's Question: {question}
|
| 435 |
+
Detected Scenario: {scenario_tag}
|
| 436 |
+
Response Tone Guidelines:
|
| 437 |
+
{emotions_context}
|
| 438 |
+
---
|
| 439 |
+
INSTRUCTIONS FOR THE AI:
|
| 440 |
+
--- CRITICAL RULE ---
|
| 441 |
+
Your response MUST be based ONLY on the information in the 'General Guidance' and 'Personal Memories' sections above. Do not invent details or add information not present in the provided context.
|
| 442 |
+
---
|
| 443 |
+
**Final Answer Rules:**
|
| 444 |
+
1. Your final answer MUST be in {language}.
|
| 445 |
+
2. Adopt the **concise, warm, and validating** tone described in the 'Response Tone Guidelines'. If the Patient's Name is provided, use it to make the opening more personal and direct.
|
| 446 |
+
3. The response must be a single, natural-sounding paragraph between 2 and 4 sentences.
|
| 447 |
+
4. Follow this three-part structure for the paragraph:
|
| 448 |
+
- Start with a varied, empathetic opening that validates the user’s feeling or concern.
|
| 449 |
+
• Do not reuse the same first sentence across turns.
|
| 450 |
+
• Invent fresh openings in each response, such as: acknowledging frustration, naming the emotion, or affirming their experience.
|
| 451 |
+
• Do not copy example text verbatim.
|
| 452 |
+
- Gently offer 1-2 of the most important practical steps from the provided context.
|
| 453 |
+
- **If possible, weave details from the 'Relevant Personal Memories' into your suggestions to make the response feel more personal and familiar.**
|
| 454 |
+
- End with a compassionate, de-escalating phrase.
|
| 455 |
+
5. **CRITICAL:** Do not include any preambles, headings, or labels like "My response is...". Address the user directly and naturally.
|
| 456 |
+
"""
|
| 457 |
|
| 458 |
# In prompts.py, replace the old ANSWER_TEMPLATE_ADQ with this revised version:
|
| 459 |
# TMP relabel ANSWER_TEMPLATE_ADQ to ANSWER_TEMPLATE_ADQ_caregiver
|