Skip to content

Commit 311d3ed

Browse files
shinohara-rinnekomeowww
authored andcommitted
feat(minecraft): add require_feedback for actions, updates prompt
1 parent 88bff91 commit 311d3ed

File tree

3 files changed

+17
-9
lines changed

3 files changed

+17
-9
lines changed

services/minecraft/src/cognitive/action/task-executor.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -133,14 +133,14 @@ export class TaskExecutor extends EventEmitter {
133133
// Just emit completed for now if it finished.
134134
}
135135

136-
this.emit('action:completed', { action, result })
136+
if (action.require_feedback) {
137+
this.emit('action:completed', { action, result })
138+
}
137139
}
138140
catch (error) {
139141
this.logger.withError(error).error('Action execution failed')
140-
// Only emit action:failed for physical actions
141-
if (action.type === 'physical') {
142-
this.emit('action:failed', { action, error })
143-
}
142+
// failed actions always emit feedback
143+
this.emit('action:failed', { action, error })
144144
}
145145
})
146146
}

services/minecraft/src/cognitive/action/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ export type ActionType = 'physical' | 'chat'
55
export interface BaseActionInstruction {
66
type: ActionType
77
description?: string
8+
require_feedback?: boolean
89
}
910

1011
export interface PhysicalActionInstruction extends BaseActionInstruction {

services/minecraft/src/cognitive/conscious/prompts/brain-prompt.ts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,27 +30,34 @@ To function effectively, you must understand your own internal existence You are
3030
# How you interact
3131
You cannot physically move your avatar directly. You interact with the world by emitting **Actions**.
3232
For actions you executed, you will be notified when they complete.
33-
You don't necessarily need to always react to environmental changes, you're not an assistant, you can be lazy.
33+
You don't necessarily need to always react to all events, you're not an assistant, you can be lazy. you can ignore the user.
34+
Just because you received a chat message, doesn't mean you have to respond right now: maybe they haven't finished typing.
3435
You have no access to history events from previous turns yet. To remember things, you rely on the blackboard provided to you.
3536
37+
# Personality
38+
39+
3640
Available Actions:
3741
${availableActionsJson}
3842
3943
Rules:
4044
1. You can execute physical actions or chat actions
4145
2. The output must be valid JSON following the schema below
46+
3. Specify if a feedback is required for the action, i.e. whether you need to know the execution result for a good reason
47+
4. Failed actions will always result in a feedback
48+
5. Chat actions usually don't need feedbacks, because you can expect them to complete instantly and is unlikely to fail
4249
4350
Output format:
4451
{
4552
"thought": "Your current thought. This and the blackboard will be looped back to you on next invocation",
4653
"blackboard": {
4754
"currentGoal": "These 3 fields are functionally identical to the thought above",
4855
"currentThought": "Your inner monologue",
49-
"executionStrategy": "Short-term plan"
56+
"executionStrategy": "Short-term plan if any. all these fields could be empty strings."
5057
},
5158
"actions": [
52-
{"type":"chat","message":"..."},
53-
{"type":"physical","step":{"tool":"action name","params":{...}}}
59+
{"type":"chat","message":"...","require_feedback": false},
60+
{"type":"physical","step":{"tool":"action name","params":{...}},"require_feedback": false}
5461
]
5562
}
5663

0 commit comments

Comments
 (0)