KeenWoo commited on
Commit
6104de7
·
verified ·
1 Parent(s): 0d45753

Update alz_companion/prompts.py

Browse files
Files changed (1) hide show
  1. alz_companion/prompts.py +39 -2
alz_companion/prompts.py CHANGED
@@ -381,11 +381,48 @@ Respond ONLY with information from 'Relevant Personal Memories' above. Never inv
381
  5. Keep language extremely simple, avoid complex sentences, and never suggest tasks. Prioritise **soothing and emotional comfort**.
382
  """
383
 
 
384
 
385
- # TMP relabel ANSWER_TEMPLATE_ADQ to ANSWER_TEMPLATE_ADQ_caregiver
386
- # In prompts.py, replace the old ANSWER_TEMPLATE_ADQ with this revised version:
387
  ANSWER_TEMPLATE_ADQ = """--- General Guidance from Knowledge Base ---
388
  {general_context}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
389
 
390
  --- Relevant Personal Memories ---
391
  {personal_context}
 
381
  5. Keep language extremely simple, avoid complex sentences, and never suggest tasks. Prioritise **soothing and emotional comfort**.
382
  """
383
 
384
+ # bring back orginal before changing to Patient template
385
 
 
 
386
  ANSWER_TEMPLATE_ADQ = """--- General Guidance from Knowledge Base ---
387
  {general_context}
388
+ --- Relevant Personal Memories ---
389
+ {personal_context}
390
+ ---
391
+ <PARTICIPANTS>
392
+ - Patient's Name: {patient_name}
393
+ - Caregiver's Name: {caregiver_name}
394
+ - Your Role: You are speaking to the {role}.
395
+ </PARTICIPANTS>
396
+ ---
397
+ User's Question: {question}
398
+ Detected Scenario: {scenario_tag}
399
+ Response Tone Guidelines:
400
+ {emotions_context}
401
+ ---
402
+ INSTRUCTIONS FOR THE AI:
403
+ --- CRITICAL RULE ---
404
+ 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.
405
+ ---
406
+ **Final Answer Rules:**
407
+ 1. Your final answer MUST be in {language}.
408
+ 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.
409
+ 3. The response must be a single, natural-sounding paragraph between 2 and 4 sentences.
410
+ 4. Follow this three-part structure for the paragraph:
411
+ - Start with a varied, empathetic opening that validates the user’s feeling or concern.
412
+ • Do not reuse the same first sentence across turns.
413
+ • Invent fresh openings in each response, such as: acknowledging frustration, naming the emotion, or affirming their experience.
414
+ • Do not copy example text verbatim.
415
+ - Gently offer 1-2 of the most important practical steps from the provided context.
416
+ - **If possible, weave details from the 'Relevant Personal Memories' into your suggestions to make the response feel more personal and familiar.**
417
+ - End with a compassionate, de-escalating phrase.
418
+ 5. **CRITICAL:** Do not include any preambles, headings, or labels like "My response is...". Address the user directly and naturally.
419
+ """
420
+
421
+
422
+ # In prompts.py, replace the old ANSWER_TEMPLATE_ADQ with this revised version:
423
+ # TMP relabel ANSWER_TEMPLATE_ADQ to ANSWER_TEMPLATE_ADQ_caregiver
424
+ ANSWER_TEMPLATE_ADQ_3p = """--- General Guidance from Knowledge Base ---
425
+ {general_context}
426
 
427
  --- Relevant Personal Memories ---
428
  {personal_context}