hiding api keys in the prompt log

This commit is contained in:
mic 2026-01-09 23:37:35 +01:00
parent de7ba70993
commit 12ba436f4d

View file

@ -430,7 +430,13 @@ export class mzta_Menus {
}
}else{ // Classic prompts for the API webchat
this.logger.log("fullPrompt: " + fullPrompt);
this.logger.log("curr_prompt: " + JSON.stringify(curr_prompt));
this.logger.log("curr_prompt: " + JSON.stringify(curr_prompt, (key, value) => {
if (typeof key === 'string' && key.endsWith('_api_key')) {
return '****************';
}
return value;
})
);
this.openChatGPT(fullPrompt, curr_prompt.action, tabs[0].id, curr_prompt.name, curr_prompt.need_custom_text, curr_prompt);
taWorkingStatus.stopWorking();
return {ok:'1'};