18 lines
550 B
JavaScript
18 lines
550 B
JavaScript
// states/ActOnMemory.js
|
|
const { chatWithAI } = require('../lib/ai-helper');
|
|
const { getBot, getStateMachine } = require('../core/context');
|
|
const config = require('../config.json');
|
|
|
|
module.exports = async function ActOnMemory() {
|
|
const bot = getBot();
|
|
console.log('[STATE] ActOnMemory');
|
|
|
|
const prompt = 'You just died. Based on what you remember, what should you do next?';
|
|
const response = await chatWithAI(prompt, config.ai);
|
|
bot.chat(response);
|
|
|
|
setTimeout(async () => {
|
|
getStateMachine().transition('Idle');
|
|
|
|
}, 5000);
|
|
};
|