diff --git a/_locales/en/messages.json b/_locales/en/messages.json index a2d5a902..40553e1a 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -1685,6 +1685,14 @@ "message": "Define the number of tokens to be used for thinking. Leave this field blank if the selected model does not support thinking or if you want to use the default method. Enter 0 to disable thinking, or -1 to enable dynamic thinking.", "description": "" }, + "prefs_google_gemini_temperature": { + "message": "Temperature", + "description": "" + }, + "prefs_google_gemini_temperature_Info": { + "message": "This parameter must be a number between 0.0 and 2.0. It controls the randomness of the output. The default value varies depending on the model. Leave it empty to avoid setting the parameter in the API call.", + "description": "" + }, "SelectAll": { "message": "Select All", "description": "" diff --git a/api_webchat/controller.js b/api_webchat/controller.js index 5f29526a..04ef964c 100644 --- a/api_webchat/controller.js +++ b/api_webchat/controller.js @@ -119,6 +119,7 @@ switch (llm) { google_gemini_api_key: prefs_default.google_gemini_api_key, google_gemini_model: prefs_default.google_gemini_model, google_gemini_system_instruction: prefs_default.google_gemini_system_instruction, + google_gemini_temperature: prefs_default.google_gemini_temperature, google_gemini_thinking_budget: prefs_default.google_gemini_thinking_budget, do_debug: prefs_default.do_debug, }); @@ -131,7 +132,12 @@ switch (llm) { if(prefs_api.google_gemini_system_instruction && prefs_api.google_gemini_system_instruction.length > 0) { additional_text_elements.push({label: browser.i18n.getMessage("GoogleGemini_SystemInstruction"), value: prefs_api.google_gemini_system_instruction}); } - additional_text_elements.push({label: 'Thinking Budget', value: prefs_api.google_gemini_thinking_budget}); + if(prefs_api.google_gemini_temperature.length > 0){ + additional_text_elements.push({label: browser.i18n.getMessage("prefs_google_gemini_temperature"), value: prefs_api.google_gemini_temperature}); + } + if(prefs_api.google_gemini_thinking_budget.length > 0){ + additional_text_elements.push({label: browser.i18n.getMessage("prefs_google_gemini_thinking_budget"), value: prefs_api.google_gemini_thinking_budget}); + } additional_text_elements.push({label: "Prompt", value: '[' + prompt_id + '] ' + decodeURIComponent(prompt_name)}); worker.postMessage({ type: 'init', diff --git a/options/mzta-options-default.js b/options/mzta-options-default.js index 6405c1a0..a10a5fea 100644 --- a/options/mzta-options-default.js +++ b/options/mzta-options-default.js @@ -46,6 +46,7 @@ export const prefs_default = { google_gemini_model: '', google_gemini_system_instruction: '', google_gemini_thinking_budget: '', + google_gemini_temperature: '', anthropic_api_key: '', anthropic_model: '', anthropic_version: '2023-06-01', diff --git a/pages/_lib/connection-ui.js b/pages/_lib/connection-ui.js index 9bbcf41a..38e41ed3 100644 --- a/pages/_lib/connection-ui.js +++ b/pages/_lib/connection-ui.js @@ -208,6 +208,19 @@ export async function injectConnectionUI({ + + + + + + + +