diff --git a/public/index.html b/public/index.html index 348a47fa3..939440aaa 100644 --- a/public/index.html +++ b/public/index.html @@ -444,7 +444,7 @@ complete. -
+
Temperature
@@ -496,7 +496,7 @@
-
+
Top K
@@ -509,7 +509,7 @@
-
+
Top P
@@ -1585,7 +1585,7 @@ - +
@@ -1833,7 +1833,7 @@ - +

OpenAI API key

@@ -2100,14 +2100,23 @@
-

PaLM API Key

+

MakerSuite API Key

- - + +
-
+
For privacy reasons, your API key will be hidden after you reload the page.
+
+

Google Model

+ +
diff --git a/public/script.js b/public/script.js index c9d45baf7..cefd9d50b 100644 --- a/public/script.js +++ b/public/script.js @@ -2557,7 +2557,7 @@ function getCharacterCardFields() { } function isStreamingEnabled() { - const noStreamSources = [chat_completion_sources.SCALE, chat_completion_sources.AI21, chat_completion_sources.PALM]; + const noStreamSources = [chat_completion_sources.SCALE, chat_completion_sources.AI21, chat_completion_sources.MAKERSUITE]; return ((main_api == 'openai' && oai_settings.stream_openai && !noStreamSources.includes(oai_settings.chat_completion_source)) || (main_api == 'kobold' && kai_settings.streaming_kobold && kai_flags.can_use_streaming) || (main_api == 'novel' && nai_settings.streaming_novel) @@ -5395,7 +5395,7 @@ function changeMainAPI() { case chat_completion_sources.CLAUDE: case chat_completion_sources.OPENAI: case chat_completion_sources.AI21: - case chat_completion_sources.PALM: + case chat_completion_sources.MAKERSUITE: default: setupChatCompletionPromptManager(oai_settings); break; @@ -7535,9 +7535,9 @@ async function connectAPISlash(_, text) { source: 'ai21', button: '#api_button_openai', }, - 'palm': { + 'makersuite': { selected: 'openai', - source: 'palm', + source: 'makersuite', button: '#api_button_openai', }, }; diff --git a/public/scripts/RossAscends-mods.js b/public/scripts/RossAscends-mods.js index f5bad628b..7235763b6 100644 --- a/public/scripts/RossAscends-mods.js +++ b/public/scripts/RossAscends-mods.js @@ -415,7 +415,7 @@ function RA_autoconnect(PrevApi) { || (oai_settings.chat_completion_source == chat_completion_sources.WINDOWAI) || (secret_state[SECRET_KEYS.OPENROUTER] && oai_settings.chat_completion_source == chat_completion_sources.OPENROUTER) || (secret_state[SECRET_KEYS.AI21] && oai_settings.chat_completion_source == chat_completion_sources.AI21) - || (secret_state[SECRET_KEYS.PALM] && oai_settings.chat_completion_source == chat_completion_sources.PALM) + || (secret_state[SECRET_KEYS.MAKERSUITE] && oai_settings.chat_completion_source == chat_completion_sources.PALM) ) { $('#api_button_openai').trigger('click'); } diff --git a/public/scripts/openai.js b/public/scripts/openai.js index a9bc5e304..7741d6c9d 100644 --- a/public/scripts/openai.js +++ b/public/scripts/openai.js @@ -164,7 +164,7 @@ export const chat_completion_sources = { SCALE: 'scale', OPENROUTER: 'openrouter', AI21: 'ai21', - PALM: 'palm', + MAKERSUITE: 'makersuite', }; const prefixMap = selected_group ? { @@ -3255,10 +3255,10 @@ async function onConnectButtonClick(e) { } if (oai_settings.chat_completion_source == chat_completion_sources.PALM) { - const api_key_palm = String($('#api_key_palm').val()).trim(); + const api_key_makersuite = String($('#api_key_makersuite').val()).trim(); - if (api_key_palm.length) { - await writeSecret(SECRET_KEYS.PALM, api_key_palm); + if (api_key_makersuite.length) { + await writeSecret(SECRET_KEYS.PALM, api_key_makersuite); } if (!secret_state[SECRET_KEYS.PALM]) { diff --git a/public/scripts/secrets.js b/public/scripts/secrets.js index 84279641d..6afb538f1 100644 --- a/public/scripts/secrets.js +++ b/public/scripts/secrets.js @@ -12,7 +12,7 @@ export const SECRET_KEYS = { SCALE: 'api_key_scale', AI21: 'api_key_ai21', SCALE_COOKIE: 'scale_cookie', - PALM: 'api_key_palm', + MAKERSUITE: 'api_key_makersuite', SERPAPI: 'api_key_serpapi', }; @@ -26,7 +26,7 @@ const INPUT_MAP = { [SECRET_KEYS.SCALE]: '#api_key_scale', [SECRET_KEYS.AI21]: '#api_key_ai21', [SECRET_KEYS.SCALE_COOKIE]: '#scale_cookie', - [SECRET_KEYS.PALM]: '#api_key_palm', + [SECRET_KEYS.MAKERSUITE]: '#api_key_makersuite', [SECRET_KEYS.APHRODITE]: '#api_key_aphrodite', [SECRET_KEYS.TABBY]: '#api_key_tabby', }; diff --git a/server.js b/server.js index 2374df5a2..6da29c278 100644 --- a/server.js +++ b/server.js @@ -995,9 +995,9 @@ async function sendClaudeRequest(request, response) { * @param {express.Response} response */ async function sendPalmRequest(request, response) { - const api_key_palm = readSecret(SECRET_KEYS.PALM); + const api_key_makersuite = readSecret(SECRET_KEYS.PALM); - if (!api_key_palm) { + if (!api_key_makersuite) { console.log('Palm API key is missing.'); return response.status(400).send({ error: true }); } @@ -1024,7 +1024,7 @@ async function sendPalmRequest(request, response) { controller.abort(); }); - const generateResponse = await fetch(`https://generativelanguage.googleapis.com/v1beta2/models/text-bison-001:generateText?key=${api_key_palm}`, { + const generateResponse = await fetch(`https://generativelanguage.googleapis.com/v1beta2/models/text-bison-001:generateText?key=${api_key_makersuite}`, { body: JSON.stringify(body), method: 'POST', headers: { diff --git a/src/endpoints/secrets.js b/src/endpoints/secrets.js index 54687cbeb..e4705706f 100644 --- a/src/endpoints/secrets.js +++ b/src/endpoints/secrets.js @@ -23,7 +23,7 @@ const SECRET_KEYS = { SCALE_COOKIE: 'scale_cookie', ONERING_URL: 'oneringtranslator_url', DEEPLX_URL: 'deeplx_url', - PALM: 'api_key_palm', + PALM: 'api_key_makersuite', SERPAPI: 'api_key_serpapi', };