Do not attempt a dryrun if no character has been selected

This commit is contained in:
maver 2023-07-11 21:02:42 +02:00
parent 82a11316bc
commit cf305c0395
1 changed files with 3 additions and 0 deletions

View File

@ -635,6 +635,9 @@ function prepareOpenAIMessages({
extensionPrompts,
cyclePrompt
} = {}, dryRun) {
// When there is no character selected, there is no way to accurately calculate tokens
if (!promptManager.activeCharacter && dryRun) return [null, false];
const prompts = promptManager.getPromptCollection();
const chatCompletion = new ChatCompletion();
const userSettings = promptManager.serviceSettings;