diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 1dfe4efc..598b56ea 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -642,5 +642,21 @@ "prefs_OptionText_max_prompt_length_Info" : { "message": "This is the maximum number of characters that can be used in a prompt. Otherwise, an error message will be displayed. The value is not editable for the ChatGPT Web Interface.", "description": "" + }, + "prefs_OptionText_chatgpt_web_model": { + "message": "ChatGPT Web model", + "description": "" + }, + "prefs_OptionText_chatgpt_web_model_info": { + "message": "This is the model that will be enforced for the ChatGPT Web Interface. If none is specified or an incorrect one is provided, the default model will be set by ChatGPT on the webpage.", + "description": "" + }, + "prefs_OptionText_chatgpt_web_tempchat": { + "message": "ChatGPT Web temporary chat", + "description": "" + }, + "prefs_OptionText_chatgpt_web_tempchat_info": { + "message": "If checked, the temporary chat will be used in the ChatGPT Web Interface.", + "description": "" } } \ No newline at end of file diff --git a/js/mzta-chatgpt.js b/js/mzta-chatgpt.js index b6bcd255..7c0f1d56 100644 --- a/js/mzta-chatgpt.js +++ b/js/mzta-chatgpt.js @@ -80,7 +80,7 @@ async function chatgpt_isIdle() { }}, 100);});} function chatgpt_getRegenerateButton() { - for (const mainSVG of document.querySelectorAll('main svg')) { + for (const mainSVG of document.querySelectorAll('main svg.icon-md')) { if (mainSVG.querySelector('path[d^="M3.06957"]')) // regen icon found return mainSVG.parentNode.parentNode; } diff --git a/mzta-background.js b/mzta-background.js index 42b7af00..c760a83a 100644 --- a/mzta-background.js +++ b/mzta-background.js @@ -244,7 +244,7 @@ async function openChatGPT(promptText, action, curr_tabId, prompt_name = '', do_ taLog.changeDebug(prefs.do_debug); prefs = checkScreenDimensions(prefs); //console.log(">>>>>>>>>>>>>>>> prefs: " + JSON.stringify(prefs)); - taLog.log("[ThunderAI] Prompt length: " + promptText.length); + taLog.log("Prompt length: " + promptText.length); if(promptText.length > prefs.max_prompt_length){ // Prompt too long for ChatGPT let tabs = await browser.tabs.query({ active: true, currentWindow: true }); @@ -259,9 +259,20 @@ async function openChatGPT(promptText, action, curr_tabId, prompt_name = '', do_ // We are using the ChatGPT web interface let rand_call_id = '_chatgptweb_' + generateCallID(); + let call_opt = ''; + + if(prefs.chatgpt_web_tempchat){ + call_opt += '&temporary-chat=true'; + } + + if(prefs.chatgpt_web_model != ''){ + call_opt += '&model=' + encodeURIComponent(prefs.chatgpt_web_model).toLowerCase(); + } + + taLog.log("[chatgpt_web] call_opt: " + call_opt); let win_options = { - url: "https://chatgpt.com?call_id=" + rand_call_id, + url: "https://chatgpt.com?call_id=" + rand_call_id + call_opt, type: "popup", } diff --git a/options/mzta-options-default.js b/options/mzta-options-default.js index 1e5d97a6..f49f83af 100644 --- a/options/mzta-options-default.js +++ b/options/mzta-options-default.js @@ -22,6 +22,8 @@ export const prefs_default = { chatgpt_win_width: 700, default_chatgpt_lang: '', connection_type: 'chatgpt_web', //Other values: 'chatgpt_api', 'ollama_api', 'openai_comp_api' + chatgpt_web_model: '', + chatgpt_web_tempchat: false, chatgpt_api_key: '', chatgpt_model: '', ollama_host: '', diff --git a/options/mzta-options.html b/options/mzta-options.html index ab55973f..7a9f3ec7 100644 --- a/options/mzta-options.html +++ b/options/mzta-options.html @@ -110,6 +110,28 @@