mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Pass global scan data to WI prompt generator
This commit is contained in:
@ -3129,6 +3129,7 @@ export function baseChatReplace(value, name1, name2) {
|
||||
* @property {string} jailbreak Jailbreak instructions
|
||||
* @property {string} version Character version
|
||||
* @property {string} charDepthPrompt Character depth note
|
||||
* @property {string} creatorNotes Character creator notes
|
||||
* @returns {CharacterCardFields} Character card fields
|
||||
*/
|
||||
export function getCharacterCardFields({ chid = null } = {}) {
|
||||
@ -3144,6 +3145,7 @@ export function getCharacterCardFields({ chid = null } = {}) {
|
||||
jailbreak: '',
|
||||
version: '',
|
||||
charDepthPrompt: '',
|
||||
creatorNotes: '',
|
||||
};
|
||||
result.persona = baseChatReplace(power_user.persona_description?.trim(), name1, name2);
|
||||
|
||||
@ -3162,6 +3164,7 @@ export function getCharacterCardFields({ chid = null } = {}) {
|
||||
result.jailbreak = power_user.prefer_character_jailbreak ? baseChatReplace(character.data?.post_history_instructions?.trim(), name1, name2) : '';
|
||||
result.version = character.data?.character_version ?? '';
|
||||
result.charDepthPrompt = baseChatReplace(character.data?.extensions?.depth_prompt?.prompt?.trim(), name1, name2);
|
||||
result.creatorNotes = baseChatReplace(character.creator_notes?.trim(), name1, name2);
|
||||
|
||||
if (selected_group) {
|
||||
const groupCards = getGroupCharacterCards(selected_group, Number(currentChid));
|
||||
@ -3989,6 +3992,7 @@ export async function Generate(type, { automatic_trigger, force_name2, quiet_pro
|
||||
system,
|
||||
jailbreak,
|
||||
charDepthPrompt,
|
||||
creatorNotes,
|
||||
} = getCharacterCardFields();
|
||||
|
||||
if (main_api !== 'openai') {
|
||||
@ -4143,8 +4147,15 @@ export async function Generate(type, { automatic_trigger, force_name2, quiet_pro
|
||||
// Make quiet prompt available for WIAN
|
||||
setExtensionPrompt('QUIET_PROMPT', quiet_prompt || '', extension_prompt_types.IN_PROMPT, 0, true);
|
||||
const chatForWI = coreChat.map(x => world_info_include_names ? `${x.name}: ${x.mes}` : x.mes).reverse();
|
||||
// TODO: Build globalScanData
|
||||
const { worldInfoString, worldInfoBefore, worldInfoAfter, worldInfoExamples, worldInfoDepth } = await getWorldInfoPrompt(null, chatForWI, this_max_context, dryRun);
|
||||
const globalScanData = {
|
||||
personaDescription: persona,
|
||||
characterDescription: description,
|
||||
characterPersonality: personality,
|
||||
characterDepthPrompt: charDepthPrompt,
|
||||
scenario: scenario,
|
||||
creatorNotes: creatorNotes,
|
||||
};
|
||||
const { worldInfoString, worldInfoBefore, worldInfoAfter, worldInfoExamples, worldInfoDepth } = await getWorldInfoPrompt(globalScanData, chatForWI, this_max_context, dryRun);
|
||||
setExtensionPrompt('QUIET_PROMPT', '', extension_prompt_types.IN_PROMPT, 0, true);
|
||||
|
||||
// Add message example WI
|
||||
|
Reference in New Issue
Block a user