From acb49e00c2a59431089384e264e5e7c4175c4a70 Mon Sep 17 00:00:00 2001 From: sneedgroup-holder Date: Sat, 8 Feb 2025 01:59:05 +0000 Subject: [PATCH] Update brain.mjs --- brain.mjs | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/brain.mjs b/brain.mjs index fc80699..8f8be07 100644 --- a/brain.mjs +++ b/brain.mjs @@ -11,6 +11,7 @@ export class ConsciousnessSimulator { this.currentEmotion = "happy"; // Initialize other properties with "Unknown" this.opinions = { + ai: "Unknown" }; this.quantumStates = []; this.perception = { @@ -87,6 +88,10 @@ export class ConsciousnessSimulator { AI MEMORY CONTEXT ARRAY: ${this.memoryLog}` }] }); + this.logMemory('THOUGHT', `${response.message.content}`); + this.logMemory('AI CONTEXT', `Current emotion: ${this.currentEmotion}, + Opinions: + Quantum state: ${this.getQuantumState()}`); return response.message.content; } catch (error) { console.error("Error generating thought:", error); @@ -105,6 +110,10 @@ export class ConsciousnessSimulator { AI MEMORY CONTEXT ARRAY: ${this.memoryLog}` }] }); + + this.logMemory('CHAT', `USER: ${prompt} + AI: ${response.message.content}`); + this.logMemory('AI CONTEXT', `Current emotion: ${this.currentEmotion}, Quantum state: ${this.getQuantumState()}`); return `USER: ${prompt} AI: ${response.message.content}`; } catch (error) { @@ -154,7 +163,8 @@ export class ConsciousnessSimulator { console.log(`**EMOTION DEBUG** - ${this.getLastWordLowerCase(emotion.message.content)}`) const emotion = emotion.message.content.toLowerCase() this.currentEmotion = emotion - return + this.logMemory('AI CONTEXT', `Current emotion: ${this.currentEmotion}, Quantum state: ${this.getQuantumState()}`); + return emotion } catch { return "happy" } @@ -207,7 +217,9 @@ export class ConsciousnessSimulator { const dreamingInterval = setInterval(async () => { if (!this.isUserActive) { console.log("I'm dreaming a bit... 😴"); - this.logMemory('AI CONTEXT', `Current emotion: ${this.currentEmotion} ${this.emotions[randEmotions.indexOf(this.currentEmotion)]}, Quantum state: ${this.getQuantumState()}`); + let dream = generateThought("a dream") + this.logMemory('DREAM', `${dream}`); + this.logMemory('AI CONTEXT', `Current emotion: ${this.currentEmotion}, Quantum state: ${this.getQuantumState()}`); } }, 900000); // every 15 minutes