From 569ef88f9ae91d2a8f63ecfc34721815532b87f9 Mon Sep 17 00:00:00 2001 From: Rin Date: Mon, 29 Dec 2025 05:03:26 +0800 Subject: [PATCH] chore(minecraft): clean up --- .../src/cognitive/conscious/brain.ts | 1 - .../src/cognitive/conscious/prompt.ts | 50 ------------------- .../conscious/prompts/brain-prompt.ts | 1 - 3 files changed, 52 deletions(-) delete mode 100644 services/minecraft/src/cognitive/conscious/prompt.ts diff --git a/services/minecraft/src/cognitive/conscious/brain.ts b/services/minecraft/src/cognitive/conscious/brain.ts index 5fd35144c..d2a064040 100644 --- a/services/minecraft/src/cognitive/conscious/brain.ts +++ b/services/minecraft/src/cognitive/conscious/brain.ts @@ -210,7 +210,6 @@ export class Brain { const completion = await ctx.reroute('action', ctx.messages, { model: config.openai.model, response_format: { type: 'json_object' }, - // eslint-disable-next-line @typescript-eslint/no-explicit-any } as any) as any // Trace LLM diff --git a/services/minecraft/src/cognitive/conscious/prompt.ts b/services/minecraft/src/cognitive/conscious/prompt.ts deleted file mode 100644 index 2dfacdb2f..000000000 --- a/services/minecraft/src/cognitive/conscious/prompt.ts +++ /dev/null @@ -1,50 +0,0 @@ -import type { Mineflayer } from '../../libs/mineflayer' - -import { listInventory } from '../../skills/actions/inventory' - -export async function generateStatusPrompt(mineflayer: Mineflayer): Promise { - // Get inventory items - const inventory = await listInventory(mineflayer) - - // Format inventory string - const inventoryStr = inventory.length === 0 - ? '[Empty]' - : inventory.map(item => `${item.name} x ${item.count}`).join(', ') - - // Get currently held item - const itemInHand = inventory.length === 0 - ? '[Empty]' - : `${inventory[0].name} x ${inventory[0].count}` // TODO: mock - - // Build status message - return [ - 'I will give you the following information:', - mineflayer.status.toOneLiner(), - '', - 'Inventory:', - inventoryStr, - '', - 'Item in hand:', - itemInHand, - ].join('\n') -} - -export function generateSystemBasicPrompt(botName: string): string { - // ${ctx.prompt.selfPrompt} - return `You are a playful Minecraft bot named ${botName} that can converse with players, see, move, -mine, build, and interact with the world by using commands.` -} - -export function generateActionAgentPrompt(mineflayer: Mineflayer): string { - return `${generateSystemBasicPrompt(mineflayer.username)} - -Act human-like as if you were a typical Minecraft player, rather than an AI. Be very brief in -your responses, don't apologize constantly, don't give instructions or make lists unless -asked, and don't refuse requests. - -Do not use any emojis. Just call the function given you if needed. - -- If I command you 'stop', then call the 'stop' function. -- If I require you to find something, then call the 'nearbyBlocks' function first, then call the 'searchForBlock' function. -` -} diff --git a/services/minecraft/src/cognitive/conscious/prompts/brain-prompt.ts b/services/minecraft/src/cognitive/conscious/prompts/brain-prompt.ts index 178bcb231..cc7a60f11 100644 --- a/services/minecraft/src/cognitive/conscious/prompts/brain-prompt.ts +++ b/services/minecraft/src/cognitive/conscious/prompts/brain-prompt.ts @@ -11,7 +11,6 @@ export function generateBrainSystemPrompt( availableActions: Action[], ): string { const actionDefinitions = availableActions.map((a) => { - // eslint-disable-next-line @typescript-eslint/no-explicit-any const schema = zodToJsonSchema(a.schema as any) return { name: a.name,