File size: 577 Bytes
70ca5d4
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import random

# Hardcoded emotionโ†’response mapping
responses = {
    "happiness": ["That's wonderful! ๐Ÿ˜Š", "Great to hear! ๐Ÿ˜ƒ"],
    "sadness": ["I'm sorry you're feeling sad. ๐Ÿ˜”", "I hope things get better soon.๐Ÿ˜ข"],
    "anger":   ["I understand you're upset. ๐Ÿ˜ ", "Let's take a deep breath.๐Ÿ˜Š"],
    "fear":    ["I hear your concern. ๐Ÿ˜Ÿ", "It's okay to feel anxious.๐Ÿ˜”"],
    "neutral": ["Tell me more.", "Go on..."]
}

# Return one random reply per emotion
def get_response(emotion):
    return random.choice(responses.get(emotion, responses["neutral"]))