diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 84e0f98d..1dfe4efc 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -634,5 +634,13 @@ "prefs_OptionText_placeholders_use_default_value_info": { "message": "If checked, the placeholders will be filled with the default values when no value is provided. Otherwise, the placeholders will be kept in place.", "description": "" + }, + "prefs_OptionText_max_prompt_length" : { + "message": "Max prompt length", + "description": "" + }, + "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": "" } } \ No newline at end of file diff --git a/mzta-background.js b/mzta-background.js index b91d2ee5..81ad08d7 100644 --- a/mzta-background.js +++ b/mzta-background.js @@ -245,7 +245,7 @@ async function openChatGPT(promptText, action, curr_tabId, prompt_name = '', do_ prefs = checkScreenDimensions(prefs); //console.log(">>>>>>>>>>>>>>>> prefs: " + JSON.stringify(prefs)); taLog.log("[ThunderAI] Prompt length: " + promptText.length); - if(promptText.length > 30000 ){ + if(promptText.length > prefs.max_prompt_length){ // Prompt too long for ChatGPT browser.tabs.sendMessage(curr_tabId, { command: "promptTooLong" }); return; diff --git a/options/mzta-options-default.js b/options/mzta-options-default.js index f3b41862..1e5d97a6 100644 --- a/options/mzta-options-default.js +++ b/options/mzta-options-default.js @@ -33,4 +33,5 @@ export const prefs_default = { dynamic_menu_force_enter: false, dynamic_menu_order_alphabet: true, placeholders_use_default_value: false, + max_prompt_length: 30000, // max string length for prompt } \ No newline at end of file diff --git a/options/mzta-options.html b/options/mzta-options.html index 70ed66ac..adcbc429 100644 --- a/options/mzta-options.html +++ b/options/mzta-options.html @@ -220,6 +220,15 @@ + + __MSG_prefs_OptionText_max_prompt_length__ + + + +