| 458 | }; | 458 | }; |
| 459 | } | 459 | } |
| 460 | | 460 | |
| 461 | async function enableBannedStringsKillSwitch() { | 461 | /** |
| 462 | $('#send_banned_tokens_textgenerationwebui').prop('checked', true); | 462 | * Sets the banned strings kill switch toggle. |
| 463 | $('#send_banned_tokens_label').find('.menu_button').addClass('toggleEnabled').prop('title', t`Banned tokens/strings are being sent in the request.`); | 463 | * @param {boolean} isEnabled Kill switch state |
| 464 | settings.send_banned_tokens = true; | 464 | * @param {string} title Label title |
| 465 | saveSettingsDebounced(); | 465 | */ |
| 466 | return ''; | 466 | function toggleBannedStringsKillSwitch(isEnabled, title) { |
| 467 | } | 467 | $('#send_banned_tokens_textgenerationwebui').prop('checked', isEnabled); |
| 468 | | 468 | $('#send_banned_tokens_label').find('.menu_button').toggleClass('toggleEnabled', isEnabled).prop('title', title); |
| 469 | async function disableBannedStringsKillSwitch() { | 469 | settings.send_banned_tokens = isEnabled; |
| 470 | $('#send_banned_tokens_textgenerationwebui').prop('checked', false); | | |
| 471 | $('#send_banned_tokens_label').find('.menu_button').removeClass('toggleEnabled').prop('title', t`Banned tokens/strings are NOT being sent in the request.`); | | |
| 472 | settings.send_banned_tokens = false; | | |
| 473 | saveSettingsDebounced(); | 470 | saveSettingsDebounced(); |
| 474 | return ''; | 471 | return ''; |
| 475 | } | 472 | } |
| 476 | | | |
| 477 | /** | 473 | /** |
| 478 | * Calculates logit bias object from the logit bias list. | 474 | * Calculates logit bias object from the logit bias list. |
| 479 | * @returns {object} Logit bias object | 475 | * @returns {object} Logit bias object |