Ananthusajeev190 commited on
Commit
f2faaf3
·
verified ·
1 Parent(s): 25dd220

Upload Bluesy.py

Browse files
Files changed (1) hide show
  1. Bluesy.py +67 -0
Bluesy.py ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import random
2
+ import datetime
3
+
4
+ class AdvancedEmotionalEngine:
5
+ def __init__(self):
6
+ # The 7 Primary Cores
7
+ self.emotion_map = {
8
+ "Joy": ["Elated", "Serene", "Ecstatic", "Triumphant", "Grateful", "Radiant", "Optimistic"],
9
+ "Sadness": ["Melancholy", "Grief", "Disappointed", "Lonely", "Pensive", "Heartbroken", "Empty"],
10
+ "Anger": ["Livid", "Resentful", "Frustrated", "Indignant", "Hostile", "Aggravated", "Bitter"],
11
+ "Fear": ["Anxious", "Terrified", "Insecure", "Helpless", "Wary", "Apprehensive", "Panicked"],
12
+ "Surprise": ["Astonished", "Startled", "Confused", "Amazed", "Overwhelmed", "Shocked", "Curious"],
13
+ "Disgust": ["Repulsed", "Disapproving", "Nauseated", "Judgmental", "Averse", "Critical", "Loathing"],
14
+ "Trust": ["Secure", "Vulnerable", "Accepted", "Loyal", "Confident", "Understood", "Valued"]
15
+ }
16
+
17
+ # Generating 100+ Mini-Emotions (Procedural Generation)
18
+ self.expand_to_100_emotions()
19
+
20
+ def expand_to_100_emotions(self):
21
+ """Adds nuance to reach 100+ total emotional states."""
22
+ nuances = ["Slightly", "Intensely", "Deeply", "Secretly", "Visibly"]
23
+ new_emotions = {}
24
+
25
+ for core, minis in self.emotion_map.items():
26
+ extended = list(minis)
27
+ for m in minis:
28
+ for n in nuances:
29
+ extended.append(f"{n} {m}")
30
+ new_emotions[core] = extended
31
+
32
+ self.emotion_map = new_emotions
33
+ total = sum(len(v) for v in self.emotion_map.values())
34
+ print(f"\033[94m[INIT]: Emotional Engine loaded with {total} unique reflections.\033[0m")
35
+
36
+ def reflect_to_person(self, primary_emotion):
37
+ """Reflects a specific mini-emotion based on a primary trigger."""
38
+ if primary_emotion in self.emotion_map:
39
+ reflection = random.choice(self.emotion_map[primary_emotion])
40
+ return reflection
41
+ return "Indifferent"
42
+
43
+ # --- THE AGENT INTEGRATION ---
44
+
45
+ class EmpathicAgent:
46
+ def __init__(self, agent_id):
47
+ self.agent_id = agent_id
48
+ self.engine = AdvancedEmotionalEngine()
49
+
50
+ def interact(self, user_input):
51
+ # Example logic: If user says something "hard", trigger Fear/Sadness
52
+ # This is where your Venomous vs Anti-Venomous monologue would sit!
53
+
54
+ trigger = "Joy" # This would be decided by your AI logic
55
+ mini_feeling = self.engine.reflect_to_person(trigger)
56
+
57
+ print(f"\033[92m[Agent {self.agent_id}]: I am reflecting '{mini_feeling}' back to you.\033[0m")
58
+ self.auto_backup_reflection(mini_feeling)
59
+
60
+ def auto_backup_reflection(self, feeling):
61
+ """Saves the interaction to your Google Drive backup."""
62
+ with open("reflection_history.txt", "a") as f:
63
+ f.write(f"{datetime.datetime.now()} - Agent {self.agent_id}: {feeling}\n")
64
+
65
+ # --- RUNNING THE SYSTEM ---
66
+ agent = EmpathicAgent(agent_id=1)
67
+ agent.interact("Help me with my task")