correct prompt naming
This commit is contained in:
parent
f147a0453b
commit
cb6c93625b
3 changed files with 17 additions and 9 deletions
|
|
@ -1016,10 +1016,18 @@
|
||||||
"description": ""
|
"description": ""
|
||||||
},
|
},
|
||||||
"prompt_summarize_email_template": {
|
"prompt_summarize_email_template": {
|
||||||
|
"message": "Summarize email template",
|
||||||
|
"description": ""
|
||||||
|
},
|
||||||
|
"prompt_summarize_email_template_full_text": {
|
||||||
"message": "From: {%author%}\nTo: {%recipients%}\nCC: {%cc_list%}\nSubject: {%mail_subject%}\nDate: {%mail_datetime%}\nAttachments:\n{%mail_attachments_info%}\nBody:\n{%mail_text_body%}",
|
"message": "From: {%author%}\nTo: {%recipients%}\nCC: {%cc_list%}\nSubject: {%mail_subject%}\nDate: {%mail_datetime%}\nAttachments:\n{%mail_attachments_info%}\nBody:\n{%mail_text_body%}",
|
||||||
"description": ""
|
"description": ""
|
||||||
},
|
},
|
||||||
"prompt_summarize_email_separator": {
|
"prompt_summarize_email_separator": {
|
||||||
|
"message": "Email separator",
|
||||||
|
"description": ""
|
||||||
|
},
|
||||||
|
"prompt_summarize_email_separator_full_text": {
|
||||||
"message": "\n\n---------- NEXT EMAIL ----------\n\n",
|
"message": "\n\n---------- NEXT EMAIL ----------\n\n",
|
||||||
"description": ""
|
"description": ""
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -1029,9 +1029,9 @@ async function summarizeEmails(messages) {
|
||||||
// we have three prompts, the actual assignment for the LLM, the email
|
// we have three prompts, the actual assignment for the LLM, the email
|
||||||
// template prompt, and the email separator prompt
|
// template prompt, and the email separator prompt
|
||||||
const specialPrompts = await getSpecialPrompts();
|
const specialPrompts = await getSpecialPrompts();
|
||||||
const prompt = specialPrompts.find((prompt) => prompt.id === 'prompt_summarize');
|
const prompt = specialPrompts.find((prompt) => prompt.id === 'prompt_summarize_full_text');
|
||||||
const prompt_email = specialPrompts.find((prompt) => prompt.id === 'prompt_summarize_email_template');
|
const prompt_email = specialPrompts.find((prompt) => prompt.id === 'prompt_summarize_email_template_full_text');
|
||||||
const prompt_email_separator = specialPrompts.find((prompt) => prompt.id === 'prompt_summarize_email_separator');
|
const prompt_email_separator = specialPrompts.find((prompt) => prompt.id === 'prompt_summarize_email_separator_full_text');
|
||||||
|
|
||||||
const tabs = await browser.tabs.query({ active: true, currentWindow: true });
|
const tabs = await browser.tabs.query({ active: true, currentWindow: true });
|
||||||
const chatgpt_lang = await taPromptUtils.getDefaultLang(prompt);
|
const chatgpt_lang = await taPromptUtils.getDefaultLang(prompt);
|
||||||
|
|
|
||||||
|
|
@ -93,19 +93,19 @@ document.addEventListener("DOMContentLoaded", async () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
summarize_textarea_email_template.addEventListener("input", (event) => {
|
summarize_textarea_email_template.addEventListener("input", (event) => {
|
||||||
summarize_reset_email_template_btn.disabled = (event.target.value === browser.i18n.getMessage('prompt_summarize_email_template'));
|
summarize_reset_email_template_btn.disabled = (event.target.value === browser.i18n.getMessage('prompt_summarize_email_template_full_text'));
|
||||||
summarize_save_email_template_btn.disabled = (event.target.value === summarize_email_template.text);
|
summarize_save_email_template_btn.disabled = (event.target.value === summarize_email_template.text);
|
||||||
});
|
});
|
||||||
|
|
||||||
summarize_email_separator_textarea.addEventListener("input", (event) => {
|
summarize_email_separator_textarea.addEventListener("input", (event) => {
|
||||||
summarize_email_separator_reset_btn.disabled = (event.target.value === browser.i18n.getMessage('prompt_summarize_email_separator'));
|
summarize_email_separator_reset_btn.disabled = (event.target.value === browser.i18n.getMessage('prompt_summarize_email_separator_full_text'));
|
||||||
summarize_email_separator_save_btn.disabled = (event.target.value === summarize_email_separator.text);
|
summarize_email_separator_save_btn.disabled = (event.target.value === summarize_email_separator.text);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
// on clicking buttons, reset
|
// on clicking buttons, reset
|
||||||
summarize_reset_email_template_btn.addEventListener("click", () => {
|
summarize_reset_email_template_btn.addEventListener("click", () => {
|
||||||
summarize_textarea_email_template.value = browser.i18n.getMessage("prompt_summarize_email_template");
|
summarize_textarea_email_template.value = browser.i18n.getMessage("prompt_summarize_email_template_full_text");
|
||||||
summarize_reset_email_template_btn.disabled = true;
|
summarize_reset_email_template_btn.disabled = true;
|
||||||
let event = new Event("input", { bubbles: true, cancelable: true });
|
let event = new Event("input", { bubbles: true, cancelable: true });
|
||||||
summarize_textarea_email_template.dispatchEvent(event);
|
summarize_textarea_email_template.dispatchEvent(event);
|
||||||
|
|
@ -119,7 +119,7 @@ document.addEventListener("DOMContentLoaded", async () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
summarize_email_separator_reset_btn.addEventListener("click", () => {
|
summarize_email_separator_reset_btn.addEventListener("click", () => {
|
||||||
summarize_email_separator_textarea.value = browser.i18n.getMessage("prompt_summarize_email_separator");
|
summarize_email_separator_textarea.value = browser.i18n.getMessage("prompt_summarize_email_separator_full_text");
|
||||||
summarize_email_separator_reset_btn.disabled = true;
|
summarize_email_separator_reset_btn.disabled = true;
|
||||||
let event = new Event("input", { bubbles: true, cancelable: true });
|
let event = new Event("input", { bubbles: true, cancelable: true });
|
||||||
summarize_email_separator_textarea.dispatchEvent(event);
|
summarize_email_separator_textarea.dispatchEvent(event);
|
||||||
|
|
@ -151,10 +151,10 @@ document.addEventListener("DOMContentLoaded", async () => {
|
||||||
if(summarize_prompt.text === 'prompt_summarize_full_text'){
|
if(summarize_prompt.text === 'prompt_summarize_full_text'){
|
||||||
summarize_prompt.text = browser.i18n.getMessage(summarize_prompt.text);
|
summarize_prompt.text = browser.i18n.getMessage(summarize_prompt.text);
|
||||||
}
|
}
|
||||||
if(summarize_email_template.text === 'prompt_summarize_email_template'){
|
if(summarize_email_template.text === 'prompt_summarize_email_template_full_text'){
|
||||||
summarize_email_template.text = browser.i18n.getMessage(summarize_email_template.text);
|
summarize_email_template.text = browser.i18n.getMessage(summarize_email_template.text);
|
||||||
}
|
}
|
||||||
if(summarize_email_separator.text === 'prompt_summarize_email_separator'){
|
if(summarize_email_separator.text === 'prompt_summarize_email_separator_full_text'){
|
||||||
summarize_email_separator.text = browser.i18n.getMessage(summarize_email_separator.text);
|
summarize_email_separator.text = browser.i18n.getMessage(summarize_email_separator.text);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue