diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 414482e0..9f6665d7 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -750,5 +750,13 @@ "prefs_OptionText_add_tags_Info": { "message": "If checked, a menu item will be added to the dynamic menu to add tags to emails.", "description": "" + }, + "prompt_add_tags": { + "message": "Add tags to emails", + "description": "" + }, + "prompt_add_tags_full_text": { + "message": "Analyze the following email text and generate a comma-separated list of tags that summarize its content. Use themes, key topics, and relevant descriptors as tags. Ensure the tags are concise and relevant to the email's content.\nEmail text: {%mail_text_body%}\nConsider the following details for context:\n- Sender: {%author%}\n- Recipients: {%recipients%}\n- CC list: {%cc_list%}\n- Email subject: {%mail_subject%}\nPlease base your tags on the email's text and context, ignoring unnecessary information or trivial details.", + "description": "" } } \ No newline at end of file diff --git a/js/mzta-prompts.js b/js/mzta-prompts.js index a01b0e76..a87d294b 100644 --- a/js/mzta-prompts.js +++ b/js/mzta-prompts.js @@ -73,6 +73,7 @@ const defaultPrompts = [ need_custom_text: "0", define_response_lang: "1", is_default: "1", + is_special: "0", }, { id: 'prompt_reply_advanced', @@ -85,6 +86,7 @@ const defaultPrompts = [ need_custom_text: "0", define_response_lang: "1", is_default: "1", + is_special: "0", }, { id: 'prompt_rewrite_polite', @@ -97,6 +99,7 @@ const defaultPrompts = [ need_custom_text: "0", define_response_lang: "1", is_default: "1", + is_special: "0", }, { id: 'prompt_rewrite_formal', @@ -109,6 +112,7 @@ const defaultPrompts = [ need_custom_text: "0", define_response_lang: "1", is_default: "1", + is_special: "0", }, { id: 'prompt_classify', @@ -121,6 +125,7 @@ const defaultPrompts = [ need_custom_text: "0", define_response_lang: "1", is_default: "1", + is_special: "0", }, { id: 'prompt_summarize_this', @@ -133,6 +138,7 @@ const defaultPrompts = [ need_custom_text: "0", define_response_lang: "1", is_default: "1", + is_special: "0", }, { id: 'prompt_translate_this', @@ -145,6 +151,7 @@ const defaultPrompts = [ need_custom_text: "0", define_response_lang: "0", is_default: "1", + is_special: "0", }, { id: 'prompt_this', @@ -157,7 +164,21 @@ const defaultPrompts = [ need_custom_text: "0", define_response_lang: "0", is_default: "1", + is_special: "0", }, + { + id: 'prompt_add_tags', + name: "__MSG_prompt_add_tags__", + text: "prompt_add_tags_full_text", + type: "1", + action: "0", + need_selected: "0", + need_signature: "0", + need_custom_text: "0", + define_response_lang: "0", + is_default: "1", + is_special: "1", + } ]; @@ -167,6 +188,7 @@ export async function getPrompts(onlyEnabled = false){ const customPrompts = await getCustomPrompts(); // console.log('>>>>>>>>>>>> getPrompts customPrompts: ' + JSON.stringify(customPrompts)); let output = _defaultPrompts.concat(customPrompts); + output = output.filter(obj => obj.is_special != 1); // we do not want special prompts if(onlyEnabled){ output = output.filter(obj => obj.enabled != 0); }else{ // order only if we are not filtering, the filtering is for the menus and we are ordering there after i18n