FerrellSyntheticIntelligence commited on
Commit ·
d66263c
1
Parent(s): c99bf3c
Wire ThalamicLoop, PinealGland, ValenceEngine into conversation layer
Browse files
src/conversation/interface.py
CHANGED
|
@@ -23,6 +23,9 @@ class VitalisConversation:
|
|
| 23 |
self.kernel = VitalisKernel()
|
| 24 |
self.resonance = ResonanceEngine()
|
| 25 |
self.understanding = UnderstandingEngine()
|
|
|
|
|
|
|
|
|
|
| 26 |
self.session_start = time.time()
|
| 27 |
self.exchange_count = 0
|
| 28 |
print("[VITALIS] Online.\n")
|
|
@@ -171,10 +174,24 @@ class VitalisConversation:
|
|
| 171 |
if not text.strip():
|
| 172 |
return "I'm listening."
|
| 173 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 174 |
u = self.understanding.understand(text)
|
| 175 |
decision = self.mind.process(text)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 176 |
self.mind.outcome(text, True)
|
| 177 |
response = self._generate_response(text, u, decision)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 178 |
self.exchange_count += 1
|
| 179 |
return response
|
| 180 |
|
|
|
|
| 23 |
self.kernel = VitalisKernel()
|
| 24 |
self.resonance = ResonanceEngine()
|
| 25 |
self.understanding = UnderstandingEngine()
|
| 26 |
+
self.valence = __import__('src.valence.valence_engine', fromlist=['ValenceEngine']).ValenceEngine()
|
| 27 |
+
self.thalamus = __import__('src.thalamus.thalamic_loop', fromlist=['ThalamicLoop']).ThalamicLoop(self.valence)
|
| 28 |
+
self.pineal = __import__('src.pineal.pineal_gland', fromlist=['PinealGland']).PinealGland()
|
| 29 |
self.session_start = time.time()
|
| 30 |
self.exchange_count = 0
|
| 31 |
print("[VITALIS] Online.\n")
|
|
|
|
| 174 |
if not text.strip():
|
| 175 |
return "I'm listening."
|
| 176 |
|
| 177 |
+
# Full thalamic pipeline
|
| 178 |
+
thalamic = self.thalamus.process_text(text, force=True)
|
| 179 |
+
self.pineal.tick(cycle_success=thalamic['passes'], confidence=thalamic['salience'])
|
| 180 |
+
|
| 181 |
u = self.understanding.understand(text)
|
| 182 |
decision = self.mind.process(text)
|
| 183 |
+
|
| 184 |
+
# Reinforce valence based on outcome
|
| 185 |
+
if thalamic['error_vec'] is not None:
|
| 186 |
+
self.valence.reinforce(thalamic['hv'], reward=1.0 if decision['confidence'] > 0.5 else -0.3)
|
| 187 |
+
|
| 188 |
self.mind.outcome(text, True)
|
| 189 |
response = self._generate_response(text, u, decision)
|
| 190 |
+
|
| 191 |
+
# Add thalamic awareness to response if novel
|
| 192 |
+
if thalamic['is_novel'] and thalamic['surprise'] > 0.8:
|
| 193 |
+
response += f" [Novel input — surprise={thalamic['surprise']:.2f}]"
|
| 194 |
+
|
| 195 |
self.exchange_count += 1
|
| 196 |
return response
|
| 197 |
|