Merge pull request #434 from kolbytn/base_profiles

Base profiles
This commit is contained in:
Max Robinson 2025-02-06 11:45:49 -06:00 committed by GitHub
commit 61586ccfa8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 59 additions and 4 deletions

View file

@ -0,0 +1,14 @@
{
"modes": {
"self_preservation": false,
"unstuck": false,
"cowardice": false,
"self_defense": false,
"hunting": false,
"item_collecting": false,
"torch_placing": false,
"elbow_room": true,
"idle_staring": true,
"cheat": false
}
}

View file

@ -0,0 +1,14 @@
{
"modes": {
"self_preservation": false,
"unstuck": false,
"cowardice": false,
"self_defense": false,
"hunting": false,
"item_collecting": false,
"torch_placing": false,
"elbow_room": false,
"idle_staring": true,
"cheat": true
}
}

View file

@ -0,0 +1,14 @@
{
"modes": {
"self_preservation": true,
"unstuck": true,
"cowardice": false,
"self_defense": true,
"hunting": true,
"item_collecting": true,
"torch_placing": true,
"elbow_room": true,
"idle_staring": true,
"cheat": false
}
}

View file

@ -10,6 +10,8 @@ export default
"mindserver_host": "localhost",
"mindserver_port": 8080,
// the base profile is shared by all bots for default prompts/examples/modes
"base_profile": "./profiles/defaults/survival.json", // also see creative.json, god_mode.json
"profiles": [
"./andy.json",
// "./profiles/gpt.json",
@ -23,6 +25,7 @@ export default
// "./profiles/deepseek.json",
// using more than 1 profile requires you to /msg each bot indivually
// individual profiles override values from the base profile
],
"load_memory": false, // load memory from previous session
"init_message": "Respond with hello world and your name", // sends to all on spawn

View file

@ -24,12 +24,22 @@ export class Prompter {
constructor(agent, fp) {
this.agent = agent;
this.profile = JSON.parse(readFileSync(fp, 'utf8'));
this.default_profile = JSON.parse(readFileSync('./profiles/_default.json', 'utf8'));
let default_profile = JSON.parse(readFileSync('./profiles/defaults/_default.json', 'utf8'));
let base_fp = settings.base_profile;
let base_profile = JSON.parse(readFileSync(base_fp, 'utf8'));
for (let key in this.default_profile) {
if (this.profile[key] === undefined)
this.profile[key] = this.default_profile[key];
// first use defaults to fill in missing values in the base profile
for (let key in default_profile) {
if (base_profile[key] === undefined)
base_profile[key] = default_profile[key];
}
// then use base profile to fill in missing values in the individual profile
for (let key in base_profile) {
if (this.profile[key] === undefined)
this.profile[key] = base_profile[key];
}
// base overrides default, individual overrides base
this.convo_examples = null;
this.coding_examples = null;