mindcraft icon indicating copy to clipboard operation
mindcraft copied to clipboard

Failed to initialize examples

Open fieldisrequired opened this issue 11 months ago • 6 comments

MindServer running on port 8080 Client connected Registering agents: friend Agents registered Starting agent with profile: ./andy.json Starting agent initialization with profile: ./andy.json Initializing action manager... Initializing prompter... Using embedding settings: { api: 'none' } Unknown embedding: none . Using word overlap. Initializing history... Initializing coder... Initializing npc controller... Initializing memory bank... Initializing self prompter... Initializing examples... Failed to initialize examples: {} Agent start failed with error {} Failed to start agent process: {} Agent process exited with code 1 and signal null Agent process ./andy.json exited too quickly and will not be restarted.

fieldisrequired avatar Feb 06 '25 05:02 fieldisrequired

same thing happens to me

Zyzzyva0381 avatar Feb 08 '25 08:02 Zyzzyva0381

same

DXENDBucket avatar Feb 08 '25 11:02 DXENDBucket

Tested on e1a9ed811b6690a60d6f14908e0ba1609c397e99 Jan 25th merge as a control. Working as expected.

Threw a try catch in skill_library,js:initSkillLibrary() and seems that is where it is failing and why we get the Failed to initialize examples: {} error.

 async initSkillLibrary() {
        console.log('Initializing Skill Library...');
        const skillDocs = getSkillDocs();
        const embeddingPromises = skillDocs.map((doc) => {
            return (async () => {
                try {
                let func_name_desc = doc.split('\n').slice(0, 2).join('');
                this.skill_docs_embeddings[doc] = await this.embedding_model.embed(func_name_desc);
                }
                catch (error) {
                    console.log(`Error initializing SkillDoc: ${doc}`);
                    console.log(error);
                }
            })();
        });
        console.log('Skill Library Initialized.');
        await Promise.all(embeddingPromises);
    }

Outputs:

Error initializing SkillDoc: skills.activateNearestBlock
* Activate the nearest block of the given type.
     * @param {MinecraftBot} bot, reference to the minecraft bot.
     * @param {string} type, the type of block to activate.
     * @returns {Promise<boolean>} true if the block was activated, false otherwise.
     * @example
     * await skills.activateNearestBlock(bot, "lever");
     *
{}
Error initializing SkillDoc: skills.attackEntity
* Attack mob of the given type.
     * @param {MinecraftBot} bot, reference to the minecraft bot.
     * @param {Entity} entity, the entity to attack.
     * @returns {Promise<boolean>} true if the entity was attacked, false if interrupted
     * @example
     * await skills.attackEntity(bot, entity);
{}
Error initializing SkillDoc: skills.attackNearest
* Attack mob of the given type.
     * @param {MinecraftBot} bot, reference to the minecraft bot.
     * @param {string} mobType, the type of mob to attack.
     * @param {boolean} kill, whether or not to continue attacking until the mob is dead. Defaults to true.
     * @returns {Promise<boolean>} true if the mob was attacked, false if the mob type was not found.
     * @example
     * await skills.attackNearest(bot, "zombie", true);
{}
Error initializing SkillDoc: skills.avoidEnemies
... etc

edit: Testing with llama3 and text-embed-nomic on WSL2 Ubuntu with Ollama 0.5.7 and node v22.13.1 (lts)

Zgrill2 avatar Feb 09 '25 17:02 Zgrill2

Alright solved it, seems that the old way of specifying embeddings for ollama is broken. Can no longer do this: "embedding": "nomic-embed-text" must do this:

"embedding": {
        "model": "nomic-embed-text",
        "api": "ollama"
    }

@MaxRobinsonTheGreat as it was your changes that affected this, do you want to continue supporting the old way of specifying embeddings or not? (fyi I only confirmed this for ollama)

Zgrill2 avatar Feb 09 '25 17:02 Zgrill2

It also seems that this error occurs if no embedding model is provided. Previously an embedding model was not required.

Zgrill2 avatar Feb 09 '25 17:02 Zgrill2

Still not working. I am using a profile with this schema:

{
    "name": "lm-studio",
    "model": {
        "model": "andy-3.5",
        "url": "http://localhost:1234/v1",
        "api": "openai"
    },
    "embedding": {
        "model": "text-embedding-nomic-embed-text-v1.5",
        "url": "http://localhost:1234/v1",
        "api": "openai"
    }
}

merll002 avatar Feb 12 '25 20:02 merll002