Update brain.mjs
This commit is contained in:
parent
faf9d3e8fa
commit
acb49e00c2
1 changed files with 14 additions and 2 deletions
16
brain.mjs
16
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
|
||||
|
||||
|
|
Loading…
Reference in a new issue