From 1ed94ba797401e6e63b01efd34c1f0dd3366f87b Mon Sep 17 00:00:00 2001 From: mic Date: Mon, 22 Jul 2024 23:03:54 +0200 Subject: [PATCH] if no API key is present, fall back to the web interface. Fixes #94 --- mzta-background.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mzta-background.js b/mzta-background.js index 3da7f525..c0eeeaca 100644 --- a/mzta-background.js +++ b/mzta-background.js @@ -147,6 +147,11 @@ async function openChatGPT(promptText, action, curr_tabId, prompt_name = '', do_ return; } + // check if the API is present, otherwise open the web interface + if (prefs.api_key_chatgpt == '') { + prefs.connection_type = 'chatgpt_web'; + } + switch(prefs.connection_type){ case 'chatgpt_web': // We are using the ChatGPT web interface