Spaces:
Sleeping
Sleeping
Update alz_companion/agent.py
Browse files- alz_companion/agent.py +11 -7
alz_companion/agent.py
CHANGED
|
@@ -809,19 +809,23 @@ def make_rag_chain(vs_general: FAISS, vs_personal: FAISS, *, for_evaluation: boo
|
|
| 809 |
user_prompt = template.format(personal_context=personal_context, general_context=general_context, question=query, language=language, patient_name=p_name, caregiver_name=c_name, context=personal_context, role=role)
|
| 810 |
print("[DEBUG] Personal Route Factual / Sum / Multi PROMPT")
|
| 811 |
else: # caregiving_scenario
|
| 812 |
-
# NEXT evolution
|
| 813 |
-
# if settings.get("role") == "patient":
|
| 814 |
-
# use template = ANSWER_TEMPLATE_PATIENT
|
| 815 |
-
# else template = ANSWER_TEMPLATE_ADQ
|
| 816 |
|
| 817 |
if disease_stage == "Advanced Stage": template = ANSWER_TEMPLATE_ADQ_ADVANCED
|
| 818 |
elif disease_stage == "Moderate Stage": template = ANSWER_TEMPLATE_ADQ_MODERATE
|
| 819 |
-
else:
|
| 820 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 821 |
emotions_context = render_emotion_guidelines(kwargs.get("emotion_tag"))
|
| 822 |
# NEXT evolution
|
| 823 |
# if emotion in ["confusion", "sadness", "anxiety", "orientation_check"]:
|
| 824 |
-
# template =
|
| 825 |
user_prompt = template.format(general_context=general_context, personal_context=personal_context, question=query, scenario_tag=kwargs.get("scenario_tag"), emotions_context=emotions_context, role=role, language=language, patient_name=p_name, caregiver_name=c_name, emotion_tag=kwargs.get("emotion_tag"))
|
| 826 |
print("[DEBUG] Caregiving Scenario PROMPT")
|
| 827 |
# end
|
|
|
|
| 809 |
user_prompt = template.format(personal_context=personal_context, general_context=general_context, question=query, language=language, patient_name=p_name, caregiver_name=c_name, context=personal_context, role=role)
|
| 810 |
print("[DEBUG] Personal Route Factual / Sum / Multi PROMPT")
|
| 811 |
else: # caregiving_scenario
|
|
|
|
|
|
|
|
|
|
|
|
|
| 812 |
|
| 813 |
if disease_stage == "Advanced Stage": template = ANSWER_TEMPLATE_ADQ_ADVANCED
|
| 814 |
elif disease_stage == "Moderate Stage": template = ANSWER_TEMPLATE_ADQ_MODERATE
|
| 815 |
+
else:
|
| 816 |
+
# template = ANSWER_TEMPLATE_ADQ
|
| 817 |
+
# NEXT evolution
|
| 818 |
+
if settings.get("role") == "patient":
|
| 819 |
+
template = ANSWER_TEMPLATE_PATIENT
|
| 820 |
+
print("[DEBUG] Use ANSWER_TEMPLATE_PATIENT")
|
| 821 |
+
else
|
| 822 |
+
template = ANSWER_TEMPLATE_ADQ
|
| 823 |
+
print("[DEBUG] Use ANSWER_TEMPLATE_ADQ")
|
| 824 |
+
|
| 825 |
emotions_context = render_emotion_guidelines(kwargs.get("emotion_tag"))
|
| 826 |
# NEXT evolution
|
| 827 |
# if emotion in ["confusion", "sadness", "anxiety", "orientation_check"]:
|
| 828 |
+
# template = ANSWER_TEMPLATE_CALM
|
| 829 |
user_prompt = template.format(general_context=general_context, personal_context=personal_context, question=query, scenario_tag=kwargs.get("scenario_tag"), emotions_context=emotions_context, role=role, language=language, patient_name=p_name, caregiver_name=c_name, emotion_tag=kwargs.get("emotion_tag"))
|
| 830 |
print("[DEBUG] Caregiving Scenario PROMPT")
|
| 831 |
# end
|