Update brain.mjs

This commit is contained in:
Arma-Damna-Dillo 2025-02-08 02:28:24 +00:00
parent 9e5510da20
commit 2134c26fc4

View file

@ -38,6 +38,7 @@ export class ConsciousnessSimulator {
}
}
this.logAIContextMemory()
await this.updateEmotion()
}
redefineSpecificOpinion(opinionKey, newValue) {
@ -47,6 +48,7 @@ export class ConsciousnessSimulator {
console.log(`Opinion key "${opinionKey}" not found.`);
}
this.logAIContextMemory()
await this.updateEmotion()
}
resetOpinions() {
@ -98,6 +100,7 @@ export class ConsciousnessSimulator {
});
this.logMemory('THOUGHT', `${response.message.content}`);
this.logAIContextMemory()
await this.updateEmotion()
return response.message.content;
} catch (error) {
console.error("Error generating thought:", error);
@ -120,6 +123,7 @@ export class ConsciousnessSimulator {
this.logMemory('CHAT', `USER: ${prompt}
AI: ${response.message.content}`);
this.logAIContextMemory()
await this.updateEmotion()
return `USER: ${prompt}
AI: ${response.message.content}`;
} catch (error) {
@ -170,6 +174,7 @@ export class ConsciousnessSimulator {
const emotion = emotion.message.content.toLowerCase()
this.currentEmotion = emotion
this.logAIContextMemory()
await this.updateEmotion()
return emotion
} catch {
return "happy"