mirror of
https://github.com/kolbytn/mindcraft.git
synced 2025-07-19 22:45:17 +02:00
Update agent.js
This commit is contained in:
parent
f14f86a518
commit
15eb0fd1c6
1 changed files with 8 additions and 6 deletions
|
@ -91,6 +91,8 @@ export class Agent {
|
|||
this._setupEventHandlers(save_data, init_message);
|
||||
this.startEvents();
|
||||
|
||||
// this.task.initBotTask();
|
||||
|
||||
if (!load_mem) {
|
||||
this.task.initBotTask();
|
||||
}
|
||||
|
@ -156,10 +158,10 @@ export class Agent {
|
|||
};
|
||||
|
||||
if (save_data?.self_prompt) {
|
||||
let prompt = save_data.self_prompt;
|
||||
// add initial message to history
|
||||
this.history.add('system', prompt);
|
||||
await this.self_prompter.start(prompt);
|
||||
if (init_message) {
|
||||
this.history.add('system', init_message);
|
||||
}
|
||||
await this.self_prompter.handleLoad(save_data.self_prompt, save_data.self_prompting_state);
|
||||
}
|
||||
if (save_data?.last_sender) {
|
||||
this.last_sender = save_data.last_sender;
|
||||
|
@ -193,7 +195,7 @@ export class Agent {
|
|||
|
||||
shutUp() {
|
||||
this.shut_up = true;
|
||||
if (this.self_prompter.on) {
|
||||
if (this.self_prompter.isActive()) {
|
||||
this.self_prompter.stop(false);
|
||||
}
|
||||
convoManager.endAllConversations();
|
||||
|
@ -259,7 +261,7 @@ export class Agent {
|
|||
await this.history.add(source, message);
|
||||
this.history.save();
|
||||
|
||||
if (!self_prompt && this.self_prompter.on) // message is from user during self-prompting
|
||||
if (!self_prompt && this.self_prompter.isActive()) // message is from user during self-prompting
|
||||
max_responses = 1; // force only respond to this message, then let self-prompting take over
|
||||
for (let i=0; i<max_responses; i++) {
|
||||
if (checkInterrupt()) break;
|
||||
|
|
Loading…
Add table
Reference in a new issue