mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Add world info support for OAI. Fix regens
This commit is contained in:
@ -13,6 +13,7 @@ export {
|
||||
deleteWorldInfo,
|
||||
selectImportedWorldInfo,
|
||||
setWorldInfoSettings,
|
||||
getWorldInfoPrompt,
|
||||
}
|
||||
|
||||
let world_info = null;
|
||||
@ -30,6 +31,18 @@ const world_info_position = {
|
||||
after: 1,
|
||||
};
|
||||
|
||||
function getWorldInfoPrompt(chat2) {
|
||||
let worldInfoString = "", worldInfoBefore = "", worldInfoAfter = "";
|
||||
|
||||
if (world_info && world_info_data) {
|
||||
const activatedWorldInfo = checkWorldInfo(chat2);
|
||||
worldInfoBefore = activatedWorldInfo.worldInfoBefore;
|
||||
worldInfoAfter = activatedWorldInfo.worldInfoAfter;
|
||||
worldInfoString = worldInfoBefore + worldInfoAfter;
|
||||
}
|
||||
return { worldInfoString, worldInfoBefore, worldInfoAfter };
|
||||
}
|
||||
|
||||
function setWorldInfoSettings(settings, data) {
|
||||
if (settings.world_info_depth !== undefined)
|
||||
world_info_depth = Number(settings.world_info_depth);
|
||||
|
Reference in New Issue
Block a user