File size: 2,008 Bytes
a2bd2a7 914e8c4 a2bd2a7 4671b84 bea66c7 7b8b1dc bea66c7 914e8c4 bea66c7 7b8b1dc bea66c7 7b8b1dc bea66c7 7b8b1dc bea66c7 914e8c4 bea66c7 a2bd2a7 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
class FECController:
def __init__(self):
pass
def generate_prompt(self, final_uesp):
# Validate required keys
required_keys = [
'emotion_family',
'primary_emotion_code',
'emotion_arc_trajectory',
'resonance_pattern'
]
for key in required_keys:
if key not in final_uesp:
raise KeyError(f"Missing required key: {key}")
# Map human-readable emotion label from code
emotion_code = final_uesp['primary_emotion_code']
if emotion_code.startswith("VAR-"):
emotion_label = emotion_code.replace("VAR-", "").split('-')[0].title()
elif emotion_code.startswith("FAM-"):
emotion_label = emotion_code.replace("FAM-", "").title()
else:
emotion_label = "Unknown"
# Base fields
arc = final_uesp['emotion_arc_trajectory']
resonance = final_uesp['resonance_pattern']
# Optional fields with fallbacks
blend_states = final_uesp.get('blend_states', 'None detected')
response_strategy = final_uesp.get('response_strategy', 'RSM-DEFAULT')
tone_classification = final_uesp.get('tone_classification', 'TBD')
# Build Fusion Prompt
fusion_prompt = f"""
Contextual Emotional State:
- Primary Emotion: {emotion_label}
- Emotional Arc: {arc}
- Resonance: {resonance}
- Tone: {tone_classification}
- Blend States: {blend_states}
- Intervention Strategy: {response_strategy}
Empathic Objective:
Align your response tone and content with the above emotional context. Prioritize emotional authenticity, HEART-compliant care, and safety. Do not merely reflect emotion — respond in an emotionally aligned and supportive manner that honors the user’s lived experience.
HEART Compliance: Response must align with HEART™ ethical principles — transparency, alignment, contextuality, traceability, and emotional safety.
""".strip()
return fusion_prompt
|