mirror of
https://github.com/kolbytn/mindcraft.git
synced 2025-09-10 12:02:59 +02:00
fix behavior log
This commit is contained in:
parent
4fbf90ee0c
commit
8793b3d905
1 changed files with 3 additions and 3 deletions
|
@ -242,13 +242,13 @@ export class Agent {
|
||||||
|
|
||||||
const checkInterrupt = () => this.self_prompter.shouldInterrupt(self_prompt) || this.shut_up || convoManager.responseScheduledFor(source);
|
const checkInterrupt = () => this.self_prompter.shouldInterrupt(self_prompt) || this.shut_up || convoManager.responseScheduledFor(source);
|
||||||
|
|
||||||
let behavior_log = this.bot.modes.flushBehaviorLog();
|
let behavior_log = this.bot.modes.flushBehaviorLog().trim();
|
||||||
if (behavior_log.trim().length > 0) {
|
if (behavior_log.length > 0) {
|
||||||
const MAX_LOG = 500;
|
const MAX_LOG = 500;
|
||||||
if (behavior_log.length > MAX_LOG) {
|
if (behavior_log.length > MAX_LOG) {
|
||||||
behavior_log = '...' + behavior_log.substring(behavior_log.length - MAX_LOG);
|
behavior_log = '...' + behavior_log.substring(behavior_log.length - MAX_LOG);
|
||||||
}
|
}
|
||||||
behavior_log = 'Recent behaviors log: \n' + behavior_log.substring(behavior_log.indexOf('\n'));
|
behavior_log = 'Recent behaviors log: \n' + behavior_log;
|
||||||
await this.history.add('system', behavior_log);
|
await this.history.add('system', behavior_log);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue