Center globe icon

This commit is contained in:
maver 2023-07-28 15:23:15 +02:00
parent f0830e7bb4
commit 222fd3429d
3 changed files with 15 additions and 13 deletions

View File

@ -29,6 +29,11 @@
color: var(--white50a);
}
#completion_prompt_manager #completion_prompt_manager_list .completion_prompt_manager_prompt .completion_prompt_manager_prompt_name .fa-solid.fa-globe {
/* For a special kind of people */
padding-left: 0.4em;
}
#completion_prompt_manager #completion_prompt_manager_list .completion_prompt_manager_prompt_invisible {
display: none;
}

View File

@ -3,9 +3,7 @@ import {TokenHandler} from "./openai.js";
import {power_user} from "./power-user.js";
/**
* Register migrations for the prompt manager when settings are loaded or an open ai preset is loaded.
*
* @function registerPromptManagerMigration
* Register migrations for the prompt manager when settings are loaded or an Open AI preset is loaded.
*/
const registerPromptManagerMigration = () => {
const migrate = (settings) => {
@ -893,7 +891,8 @@ PromptManagerModule.prototype.getPromptIndexById = function (identifier) {
}
/**
* Prepares a prompt by creating a new object with its role and content.
* Enriches a generic object, creating a new prompt object in the process
*
* @param {Object} prompt - Prompt object
* @param original
* @returns {Object} An object with "role" and "content" properties
@ -967,6 +966,7 @@ PromptManagerModule.prototype.loadMessagesIntoInspectForm = function (messages)
let drawerHTML = `
<div class="inline-drawer ${this.configuration.prefix}prompt_manager_prompt">
<div class="inline-drawer-toggle inline-drawer-header">
<span>${title}</span>
<span>${title}</span>
<div class="fa-solid fa-circle-chevron-down inline-drawer-icon down"></div>
</div>
@ -1122,9 +1122,6 @@ PromptManagerModule.prototype.renderPromptManager = function () {
promptManagerDiv.insertAdjacentHTML('beforeend', `
<div class="range-block-title" data-i18n="Prompts">
Prompts
<a href="/notes#openaipromptmanager" target="_blank" class="notes-link">
<span class="note-link-span">?</span>
</a>
</div>
<div class="range-block">
${this.error ? errorDiv : ''}

View File

@ -629,8 +629,8 @@ function populateChatCompletion (prompts, chatCompletion, {bias, quietPrompt, ty
* @returns {Object} prompts - The prepared and merged system and user-defined prompts.
*/
function preparePromptsForChatCompletion(Scenario, charPersonality, name2, worldInfoBefore, worldInfoAfter, charDescription, quietPrompt, bias, extensionPrompts) {
const scenarioText = Scenario ? `Circumstances and context of the dialogue: ${Scenario}` : '';
const charPersonalityText = charPersonality ? `${name2}'s personality: ${charPersonality}` : '';
const scenarioText = Scenario ? `[Circumstances and context of the dialogue: ${Scenario}]` : '';
const charPersonalityText = charPersonality ? `[${name2}'s personality: ${charPersonality}]` : '';
// Create entries for system prompts
const systemPrompts = [
@ -757,7 +757,7 @@ function prepareOpenAIMessages({
chatCompletion.setTokenBudget(userSettings.openai_max_context, userSettings.openai_max_tokens);
try {
// Populate markers, merge markers and ordered user prompts with system prompts
// Merge markers and ordered user prompts with system prompts
const prompts = preparePromptsForChatCompletion(Scenario, charPersonality, name2, worldInfoBefore, worldInfoAfter, charDescription, quietPrompt, bias, extensionPrompts);
// Fill the chat completion with as much context as the budget allows
@ -770,9 +770,9 @@ function prepareOpenAIMessages({
} else if (error instanceof InvalidCharacterNameError) {
toastr.warning('An error occurred while counting tokens: Invalid character name')
chatCompletion.log('Invalid character name');
promptManager.error = 'The name of at least one character contained whitespaces or special characters. Please check your user and character name';
promptManager.error = 'The name of at least one character contained whitespaces or special characters. Please check your user and character name.';
} else {
toastr.error('An unknown error occurred while counting tokens. Further information available in console.')
toastr.error('An unknown error occurred while counting tokens. Further information may be available in console.')
chatCompletion.log('Unexpected error:');
chatCompletion.log(error);
}
@ -780,7 +780,7 @@ function prepareOpenAIMessages({
// Pass chat completion to prompt manager for inspection
promptManager.setChatCompletion(chatCompletion);
// All information are up-to-date, render.
// All information is up-to-date, render.
if (false === dryRun) promptManager.render(false);
}