diff --git a/inc/js/factory-class-extenders/class-extenders.mjs b/inc/js/factory-class-extenders/class-extenders.mjs index 2ec0e82..43e6bcf 100644 --- a/inc/js/factory-class-extenders/class-extenders.mjs +++ b/inc/js/factory-class-extenders/class-extenders.mjs @@ -125,7 +125,6 @@ function extendClass_contribution(originClass, referencesObject) { */ function extendClass_conversation(originClass, referencesObject) { class Conversation extends originClass { - #botId #factory #messages = [] #saved = false @@ -135,13 +134,13 @@ function extendClass_conversation(originClass, referencesObject) { * @param {Object} obj - The object to construct the conversation from. * @param {AgentFactory} factory - The factory instance. * @param {Object} thread - The thread instance. - * @param {Guid} botId - The initial active bot id (can mutate) + * @param {Guid} bot_id - The initial active bot id (can mutate) */ - constructor(obj, factory, thread, botId) { + constructor(obj, factory, thread, bot_id){ super(obj) this.#factory = factory this.#thread = thread - this.#botId = botId + this.bot_id = bot_id this.form = this.form ?? 'system' this.name = `conversation_${this.#factory.mbr_id}_${thread.thread_id}` @@ -212,16 +211,16 @@ function extendClass_conversation(originClass, referencesObject) { * @returns {Guid} - The bot id. */ get botId(){ - return this.#botId + return this.bot_id } /** * Set the id {Guid} of the conversation's bot. * @setter - * @param {Guid} botId - The bot id. + * @param {Guid} bot_id - The bot id. * @returns {void} */ - set botId(botId){ - this.#botId = botId + set botId(bot_id){ + this.bot_id = bot_id } get isSaved(){ return this.#saved diff --git a/inc/js/mylife-avatar.mjs b/inc/js/mylife-avatar.mjs index ac332dc..21570c8 100644 --- a/inc/js/mylife-avatar.mjs +++ b/inc/js/mylife-avatar.mjs @@ -63,7 +63,7 @@ class Avatar extends EventEmitter { /* experience variables */ this.#experienceGenericVariables = mAssignGenericExperienceVariables(this.#experienceGenericVariables, this) /* llm services */ - this.#llmServices.botId = mBot_idOverride && this.isMyLife + this.#llmServices.bot_id = mBot_idOverride && this.isMyLife ? mBot_idOverride : this.activeBot.bot_id return this @@ -540,14 +540,14 @@ class Avatar extends EventEmitter { throw new Error('MyLife avatar cannot summarize files.') if(!fileId?.length && !fileName?.length) throw new Error('File id or name required for summarization.') - const { bot_id: botId, thread_id, } = this.personalAssistant + const { bot_id, thread_id, } = this.personalAssistant const prompt = `Summarize this file document: name=${ fileName }, id=${ fileId }` const response = { messages: [], success: false, } try{ - let messages = await mCallLLM(this.#llmServices, { botId, thread_id, }, prompt, this.#factory, this) + let messages = await mCallLLM(this.#llmServices, { bot_id, thread_id, }, prompt, this.#factory, this) messages = messages .map(message=>mPruneMessage(this.personalAssistant, message, 'mylife-file-summary', processStartTime)) .filter(message=>message && message.role!=='user') @@ -1412,8 +1412,8 @@ async function mEventDialog(llm, experience, event, iteration=0){ console.log('mEventDialog::bot id not found in cast', characterId, castMember, bot) throw new Error('Bot id not found in cast.') } - scriptDialog.botId = bot_id ?? scriptAdvisorBotId - console.log('mEventDialog::bot id found in cast', characterId, castMember.inspect(true), scriptDialog.botId) + scriptDialog.bot_id = bot_id ?? scriptAdvisorBotId + console.log('mEventDialog::bot id found in cast', characterId, castMember.inspect(true), scriptDialog.bot_id) if(example?.length) prompt = `using example: "${example}";\n` + prompt if(dialogVariables.length) @@ -1502,7 +1502,7 @@ async function mEventInput(llm, experience, event, iteration=0, memberInput){ ?? experience.cast.find(castMember=>castMember.id===characterId)?.bot?.bot_id ?? experience.cast[0]?.bot?.bot_id const scriptConsultant = scriptAdvisor ?? scriptDialog ?? dialog - scriptConsultant.botId = scriptAdvisorBotId + scriptConsultant.bot_id = scriptAdvisorBotId const messages = await mCallLLM(llm, scriptConsultant, prompt) ?? [] if(!messages.length){