Update brain.mjs
This commit is contained in:
parent
9e5510da20
commit
2134c26fc4
1 changed files with 5 additions and 0 deletions
|
@ -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"
|
||||
|
|
Loading…
Reference in a new issue