From ecfde64577c82d7b311ef9491e40716c6736c767 Mon Sep 17 00:00:00 2001 From: Mic Date: Fri, 28 Mar 2025 01:10:00 +0100 Subject: [PATCH] Fixed the prompt substitution if there are no attendees --- js/mzta-menus.js | 1 + js/mzta-utils-prompt.js | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/js/mzta-menus.js b/js/mzta-menus.js index b87610fc..f2b3248a 100644 --- a/js/mzta-menus.js +++ b/js/mzta-menus.js @@ -204,6 +204,7 @@ export class mzta_Menus { * "attendees": [attendee1@example.com,attendee2@example.com,attendee3@example.com]" * } */ + fullPrompt = taPromptUtils.finalizePrompt_get_calendar_event(fullPrompt); this.logger.log("fullPrompt: " + fullPrompt); let cmd_GetCalendarEvent = new mzta_specialCommand(fullPrompt,prefs_at.connection_type,true); await cmd_GetCalendarEvent.initWorker(); diff --git a/js/mzta-utils-prompt.js b/js/mzta-utils-prompt.js index 36cdf687..e361cabe 100644 --- a/js/mzta-utils-prompt.js +++ b/js/mzta-utils-prompt.js @@ -57,6 +57,13 @@ export const taPromptUtils = { return fullPrompt; }, + finalizePrompt_get_calendar_event(fullPrompt){ + fullPrompt = fullPrompt.replace("{%cc_list%}", ""); + fullPrompt = fullPrompt.replace("{%recipients%}", ""); + + return fullPrompt; + }, + async getDefaultLang(curr_prompt){ let chatgpt_lang = ''; if(String(curr_prompt.define_response_lang) == "1"){