From e702ab9c1ab3b13f218e9926645a5b153f09d8dc Mon Sep 17 00:00:00 2001 From: mic Date: Wed, 2 Oct 2024 23:26:36 +0200 Subject: [PATCH] init with api key --- api_webchat/controller.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api_webchat/controller.js b/api_webchat/controller.js index d1a4f674..180ccdf3 100644 --- a/api_webchat/controller.js +++ b/api_webchat/controller.js @@ -97,13 +97,13 @@ switch (llm) { break; } case "openai_comp_api": { - let prefs_api = await browser.storage.sync.get({openai_comp_host: '', openai_comp_model: '', openai_comp_chat_name: ''}); + let prefs_api = await browser.storage.sync.get({openai_comp_host: '', openai_comp_model: '', openai_comp_api_key: '', openai_comp_chat_name: ''}); let i18nStrings = {}; i18nStrings["OpenAIComp_api_request_failed"] = browser.i18n.getMessage('OpenAIComp_api_request_failed'); i18nStrings["error_connection_interrupted"] = browser.i18n.getMessage('error_connection_interrupted'); messageInput.setModel(prefs_api.openai_comp_model); messagesArea.setLLMName(prefs_api.openai_comp_chat_name); - worker.postMessage({ type: 'init', openai_comp_host: prefs_api.openai_comp_host, openai_comp_model: prefs_api.openai_comp_model, i18nStrings: i18nStrings}); + worker.postMessage({ type: 'init', openai_comp_host: prefs_api.openai_comp_host, openai_comp_model: prefs_api.openai_comp_model, openai_comp_api_key: prefs_api.openai_comp_api_key, i18nStrings: i18nStrings}); messagesArea.appendUserMessage(browser.i18n.getMessage("OpenAIComp_api_connecting") + " \"" + prefs_api.openai_comp_host + "\" " +browser.i18n.getMessage("AndModel") + " \"" + prefs_api.openai_comp_model + "\"...", "info"); break; }