Edited connection and creation in bot.js
All checks were successful
Deploy Cletus Bot / deploy (push) Successful in 14s
All checks were successful
Deploy Cletus Bot / deploy (push) Successful in 14s
This commit is contained in:
parent
af2397fc60
commit
d2f34b3607
3 changed files with 13 additions and 7 deletions
|
|
@ -14,13 +14,15 @@ const context = require('./core/context');
|
||||||
|
|
||||||
// === Bot Config ===
|
// === Bot Config ===
|
||||||
const bot = mineflayer.createBot({
|
const bot = mineflayer.createBot({
|
||||||
host: config.bot.host,
|
host: config.server.host,
|
||||||
port: config.bot.port,
|
port: config.server.port,
|
||||||
username: config.bot.name,
|
username: config.bot.name,
|
||||||
auth: config.bot.auth
|
auth: config.server.auth,
|
||||||
|
version: config.server.version
|
||||||
});
|
});
|
||||||
|
|
||||||
bot.loadPlugin(pathfinder);
|
bot.loadPlugin(pathfinder);
|
||||||
|
|
||||||
context.setBot(bot);
|
context.setBot(bot);
|
||||||
context.setDB(db);
|
context.setDB(db);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,18 @@
|
||||||
{
|
{
|
||||||
"bot": {
|
"bot": {
|
||||||
"name": "Cletus",
|
"name": "Cletus",
|
||||||
|
"persona": "a curious minecraft explorer who learns from the world around them"
|
||||||
|
},
|
||||||
|
"server": {
|
||||||
"host": "192.168.1.90",
|
"host": "192.168.1.90",
|
||||||
"port": 25565,
|
"port": "25565",
|
||||||
"auth": "offline"
|
"auth": "offline",
|
||||||
|
"version": "1.20.4"
|
||||||
|
|
||||||
},
|
},
|
||||||
"ai": {
|
"ai": {
|
||||||
"model": "gemma3",
|
"model": "gemma3",
|
||||||
"ollamaUrl": "http://192.168.1.3:11434/api/generate",
|
"ollamaUrl": "http://192.168.1.3:11434/api/generate",
|
||||||
"persona": "a curious minecraft explorer who learns from the world around them",
|
|
||||||
"responseLength": 30
|
"responseLength": 30
|
||||||
},
|
},
|
||||||
"safeZone": {
|
"safeZone": {
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ const config = require('../config.json');
|
||||||
async function chatWithAI(message, overrides = {}) {
|
async function chatWithAI(message, overrides = {}) {
|
||||||
|
|
||||||
const settings = { ...config.ai, ...overrides };
|
const settings = { ...config.ai, ...overrides };
|
||||||
const prompt = `You are ${settings.botName}, ${settings.persona}. Keep your responses around ${settings.responseLength} words. Respond to: ${message}`;
|
const prompt = `You are ${config.bot.name}, ${config.bot.persona}. Keep your responses around ${config.ai.responseLength} words. Respond to: ${message}`;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await axios.post(settings.ollamaUrl, {
|
const response = await axios.post(settings.ollamaUrl, {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue