Mineflayer ChatGPT is a Mineflayer plugin for sending a message to OpenAI's ChatGPT.
npm install mineflayer-chatgpt
or as a dependency in package.json file:
"dependencies": {
"mineflayer-chatgpt": "x.y.z"
}
Load the plugin:
import mineflayerChatgpt from 'mineflayer-chatgpt';
...
bot.loadPlugin(mineflayerChatgpt.chatgpt);
Set the configuration:
const chatGptApiKey = 'sk-1234567890abcdef';
bot.chatgpt.setConfig(chatGptApiKey, {
model: 'gpt-3.5-turbo'
});
Send a message to ChatGPT:
bot.chatgpt.sendMessage('player', 'Hello, could you please tell me how to make a diamond sword in Minecraft?');
Build reports: