Disable toggling of main prompt

This commit is contained in:
maver
2023-06-21 19:42:12 +02:00
parent 85862d8b2e
commit be30fef700
2 changed files with 42 additions and 7 deletions

View File

@ -277,6 +277,7 @@ function setupOpenAIPromptManager(openAiSettings) {
prefix: 'openai_',
containerIdentifier: 'openai_prompt_manager',
listIdentifier: 'openai_prompt_manager_list',
toggleDisabled: ['main'],
draggable: true
};
@ -580,11 +581,12 @@ async function prepareOpenAIMessages({
try {
populateChatCompletion(prompts, chatCompletion, {bias, quietPrompt, type});
} catch (error) {
toastr.error('An error occurred while counting tokens.')
if (error instanceof TokenBudgetExceededError) {
toastr.error('An error occurred while counting tokens: Token budget exceeded.')
chatCompletion.log('Token budget exceeded.');
promptManager.error = 'Not enough free tokens for mandatory prompts. Raise your token Limit or disable custom prompts.';
} else {
toastr.error('An unknown error occurred while counting tokens. Further info available in console.')
chatCompletion.log('Unexpected error:');
chatCompletion.log(error);
}