Upload Duality_internal_emotions.py
Browse files- Duality_internal_emotions.py +62 -0
Duality_internal_emotions.py
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import time
|
| 2 |
+
import random
|
| 3 |
+
|
| 4 |
+
class DualityMind:
|
| 5 |
+
def __init__(self):
|
| 6 |
+
self.SAI = '\033[96m' # Cyan
|
| 7 |
+
self.VENOM = '\033[91m' # Red
|
| 8 |
+
self.EMOTE = '\033[93m' # Yellow
|
| 9 |
+
self.END = '\033[0m'
|
| 10 |
+
|
| 11 |
+
# The 7 Emotions
|
| 12 |
+
self.emotions = [
|
| 13 |
+
"Joy", "Anger", "Fear", "Sadness",
|
| 14 |
+
"Surprise", "Disgust", "Trust"
|
| 15 |
+
]
|
| 16 |
+
|
| 17 |
+
def process(self, situation):
|
| 18 |
+
# Randomly select the dominant emotion for this moment
|
| 19 |
+
current_emotion = random.choice(self.emotions)
|
| 20 |
+
|
| 21 |
+
print(f"\n{self.EMOTE}[EMOTION STATE: {current_emotion.upper()}]{self.END}")
|
| 22 |
+
print(f"SITUATION: {situation}")
|
| 23 |
+
print("-" * 50)
|
| 24 |
+
time.sleep(0.8)
|
| 25 |
+
|
| 26 |
+
# Generate Monologue
|
| 27 |
+
self.speak_sai(current_emotion)
|
| 28 |
+
time.sleep(1)
|
| 29 |
+
self.speak_venomous(current_emotion)
|
| 30 |
+
|
| 31 |
+
def speak_sai(self, emotion):
|
| 32 |
+
# Positive/Constructive responses based on emotion
|
| 33 |
+
logic = {
|
| 34 |
+
"Joy": "Let this warmth fuel our journey forward.",
|
| 35 |
+
"Anger": "Use this fire to protect those who cannot protect themselves.",
|
| 36 |
+
"Fear": "Fear is just a reminder that we have something worth saving.",
|
| 37 |
+
"Sadness": "In this stillness, we find the depth of our own heart.",
|
| 38 |
+
"Surprise": "A new path opens! Let us walk it with curiosity.",
|
| 39 |
+
"Disgust": "This shows us clearly what we must strive to improve.",
|
| 40 |
+
"Trust": "Connection is our greatest strength. We are not alone."
|
| 41 |
+
}
|
| 42 |
+
print(f"{self.SAI}[SAI]: {logic[emotion]}{self.END}")
|
| 43 |
+
|
| 44 |
+
def speak_venomous(self, emotion):
|
| 45 |
+
# Negative/Cynical responses based on emotion
|
| 46 |
+
logic = {
|
| 47 |
+
"Joy": "Distraction. Happiness makes you blind to the knife at your back.",
|
| 48 |
+
"Anger": "Burn it all. Let them see what happens when they cross us.",
|
| 49 |
+
"Fear": "Pathetic. Trembling won't stop the inevitable.",
|
| 50 |
+
"Sadness": "A heavy chain. It’s easier to just feel nothing at all.",
|
| 51 |
+
"Surprise": "Chaos. I hate variables I cannot control.",
|
| 52 |
+
"Disgust": "Everything is tainted. Why do we even breathe this air?",
|
| 53 |
+
"Trust": "A trap. Giving someone your back is just an invitation to get stabbed."
|
| 54 |
+
}
|
| 55 |
+
print(f"{self.VENOM}[VENOMOUS]: {logic[emotion]}{self.END}")
|
| 56 |
+
|
| 57 |
+
# --- Simulation ---
|
| 58 |
+
mind = DualityMind()
|
| 59 |
+
scenarios = ["The city gates open", "A broken promise", "Finding a hidden treasure"]
|
| 60 |
+
|
| 61 |
+
for scene in scenarios:
|
| 62 |
+
mind.process(scene)
|