mzta_specialCommand has now a custom_model parameter. see #438

This commit is contained in:
Mic 2025-09-04 22:46:00 +02:00
parent 9967e28861
commit 9681a938e3

View file

@ -26,6 +26,7 @@
prompt = ""; prompt = "";
worker = null; worker = null;
llm = ""; llm = "";
custom_model = "";
full_message = ""; full_message = "";
logger = null; logger = null;
do_debug = false; do_debug = false;
@ -34,10 +35,12 @@
let { let {
prompt = '', prompt = '',
llm = '', llm = '',
custom_model = '',
do_debug = false do_debug = false
} = args; } = args;
this.prompt = prompt; this.prompt = prompt;
this.llm = llm; this.llm = llm;
this.custom_model = custom_model;
this.logger = new taLogger('mzta_specialCommand', do_debug); this.logger = new taLogger('mzta_specialCommand', do_debug);
this.do_debug = do_debug; this.do_debug = do_debug;
switch (this.llm) { switch (this.llm) {
@ -73,7 +76,7 @@
this.worker.postMessage({ this.worker.postMessage({
type: 'init', type: 'init',
chatgpt_api_key: prefs_api.chatgpt_api_key, chatgpt_api_key: prefs_api.chatgpt_api_key,
chatgpt_model: prefs_api.chatgpt_model, chatgpt_model: this.custom_model != '' ? this.custom_model : prefs_api.chatgpt_model,
chatgpt_developer_messages: prefs_api.chatgpt_developer_messages, chatgpt_developer_messages: prefs_api.chatgpt_developer_messages,
do_debug: this.do_debug, do_debug: this.do_debug,
i18nStrings: '' i18nStrings: ''
@ -89,7 +92,7 @@
this.worker.postMessage({ this.worker.postMessage({
type: 'init', type: 'init',
google_gemini_api_key: prefs_api.google_gemini_api_key, google_gemini_api_key: prefs_api.google_gemini_api_key,
google_gemini_model: prefs_api.google_gemini_model, google_gemini_model: this.custom_model != '' ? this.custom_model : prefs_api.google_gemini_model,
google_gemini_system_instruction: prefs_api.google_gemini_system_instruction, google_gemini_system_instruction: prefs_api.google_gemini_system_instruction,
do_debug: this.do_debug, do_debug: this.do_debug,
i18nStrings: '' i18nStrings: ''
@ -104,7 +107,7 @@
this.worker.postMessage({ this.worker.postMessage({
type: 'init', type: 'init',
ollama_host: prefs_api.ollama_host, ollama_host: prefs_api.ollama_host,
ollama_model: prefs_api.ollama_model, ollama_model: this.custom_model != '' ? this.custom_model : prefs_api.ollama_model,
do_debug: this.do_debug, do_debug: this.do_debug,
i18nStrings: '' i18nStrings: ''
}); });
@ -121,7 +124,7 @@
this.worker.postMessage({ this.worker.postMessage({
type: 'init', type: 'init',
openai_comp_host: prefs_api.openai_comp_host, openai_comp_host: prefs_api.openai_comp_host,
openai_comp_model: prefs_api.openai_comp_model, openai_comp_model: this.custom_model != '' ? this.custom_model : prefs_api.openai_comp_model,
openai_comp_api_key: prefs_api.openai_comp_api_key, openai_comp_api_key: prefs_api.openai_comp_api_key,
openai_comp_use_v1: prefs_api.openai_comp_use_v1, openai_comp_use_v1: prefs_api.openai_comp_use_v1,
do_debug: this.do_debug, do_debug: this.do_debug,
@ -139,7 +142,7 @@
this.worker.postMessage({ this.worker.postMessage({
type: 'init', type: 'init',
anthropic_api_key: prefs_api.anthropic_api_key, anthropic_api_key: prefs_api.anthropic_api_key,
anthropic_model: prefs_api.anthropic_model, anthropic_model: this.custom_model != '' ? this.custom_model : prefs_api.anthropic_model,
anthropic_version: prefs_api.anthropic_version, anthropic_version: prefs_api.anthropic_version,
anthropic_max_tokens: prefs_api.anthropic_max_tokens, anthropic_max_tokens: prefs_api.anthropic_max_tokens,
do_debug: this.do_debug, do_debug: this.do_debug,