mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Render prompt manager before a character is selected
When prompt order strategy is global
This commit is contained in:
@ -273,6 +273,8 @@ PromptManagerModule.prototype.init = function (moduleConfiguration, serviceSetti
|
|||||||
this.serviceSettings = serviceSettings;
|
this.serviceSettings = serviceSettings;
|
||||||
this.containerElement = document.getElementById(this.configuration.containerIdentifier);
|
this.containerElement = document.getElementById(this.configuration.containerIdentifier);
|
||||||
|
|
||||||
|
if ('global' === this.configuration.promptOrder.strategy) this.activeCharacter = {id: this.configuration.promptOrder.dummyId};
|
||||||
|
|
||||||
this.sanitizeServiceSettings();
|
this.sanitizeServiceSettings();
|
||||||
|
|
||||||
// Enable and disable prompts
|
// Enable and disable prompts
|
||||||
@ -592,7 +594,7 @@ PromptManagerModule.prototype.init = function (moduleConfiguration, serviceSetti
|
|||||||
PromptManagerModule.prototype.render = function (afterTryGenerate = true) {
|
PromptManagerModule.prototype.render = function (afterTryGenerate = true) {
|
||||||
if (main_api !== 'openai') return;
|
if (main_api !== 'openai') return;
|
||||||
|
|
||||||
if (null === this.activeCharacter) return;
|
if ('character' === this.configuration.promptOrder.strategy && null === this.activeCharacter) return;
|
||||||
this.error = null;
|
this.error = null;
|
||||||
|
|
||||||
waitUntilCondition(() => !is_send_press && !is_group_generating, 1024 * 1024, 100).then(() => {
|
waitUntilCondition(() => !is_send_press && !is_group_generating, 1024 * 1024, 100).then(() => {
|
||||||
|
@ -19,7 +19,6 @@ import {
|
|||||||
system_message_types,
|
system_message_types,
|
||||||
replaceBiasMarkup,
|
replaceBiasMarkup,
|
||||||
is_send_press,
|
is_send_press,
|
||||||
saveSettings,
|
|
||||||
Generate,
|
Generate,
|
||||||
main_api,
|
main_api,
|
||||||
eventSource,
|
eventSource,
|
||||||
@ -389,7 +388,7 @@ function setupChatCompletionPromptManager(openAiSettings) {
|
|||||||
promptManager.tokenHandler = tokenHandler;
|
promptManager.tokenHandler = tokenHandler;
|
||||||
|
|
||||||
promptManager.init(configuration, openAiSettings);
|
promptManager.init(configuration, openAiSettings);
|
||||||
promptManager.render();
|
promptManager.render(false);
|
||||||
|
|
||||||
return promptManager;
|
return promptManager;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user