Spaces:
Sleeping
Sleeping
| 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"])) |