Commit Graph

58 Commits

Author SHA1 Message Date
d66542e88e fix: MovingUI breaking, typos, WI selector scroll 2023-06-28 20:40:29 +09:00
2f2f88dedd World Info: Fix array splice method
Character lore layers used array.splice() in the wrong way. Somehow
this passed my testing through sheer luck. Rewrite for using indicies
to splice and for more efficiency with iteration.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-06-27 21:04:04 -04:00
69fdb9090f Add Chub downloader for characters and lorebooks 2023-06-27 18:39:08 +03:00
3e30fb5d14 World Info: Fix lorebook loading error
charLore isn't always present, so make optional calls to it.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-06-26 20:19:21 -04:00
45047fc6b2 World Info: Fix entries being improperly appended
Entries were being added to the prompt in an inconsistent way. WI
before and after character were using newline formatting while AN
was using array joins. This caused some issues with insertion order
in the prompt.

Fix this by making each injection use an array and unshift elements
into them. Then, join them into a string that preserves insertion
order.

The reason why unshift is used is because higher insertion orders
translate to a higher priority during scanning. This prevents the
need to reverse arrays which is a more costly function depending
on how many entries are in them.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-06-26 14:32:24 -04:00
9d5af39682 World Info: Add rename and delete hooks to char layers
If a world info is renamed or deleted, update that in the character
lore section of settings as well.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-06-26 14:32:24 -04:00
b6fbe41f93 World Info: Add support for character layering
Some characters have different cards depending on what the user wants
from the character. However, maintaining multiple lorebooks for different
personas of the same character can be difficult. In addition, there
is redundancy, overlap, and possiblities to miss information when
creating separate lorebooks with the same base info.

Therefore, add a "DLC"/layering system of sorts for characters.
This works the same way as multi-global world info where character
lorebooks added as needed. The only catch is that a base character
book must be tied to a card before selecting any extra info.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-06-26 14:32:24 -04:00
9532ad4e5a Enable selection in WI editor 2023-06-25 23:24:22 +03:00
7984e3b818 Add contextual Character WI button 2023-06-25 18:40:13 +03:00
26ac519c55 User persona management block. Persona descriptions. Dummy personas. Change persona avatar 2023-06-25 16:46:23 +03:00
951e22ac8e Fix scrolling and width of global WI 2023-06-25 12:43:37 +03:00
c0286150ed World Info: Add optimizations and fixes
Use a switch instead of if/else chain, fix un-needed addition
when determining token counts, and remove newline spacing for AN
WI formatting.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-06-25 01:00:47 -04:00
fc9c90c4ee World Info: Add global multi-selection/merging
Global world info always involved some kind of merging leading to
extremely large lorebook files that took a long time to import.

This commit adds the ability to select more than one world info file
and they will be merged together along with character world info.
In short, multiple worlds can be meshed together to further contribute
to context.

You can also use this for world "DLCs" of sorts. Let's say someone
else has more information to add regarding a world, but doesn't
want to use a large world file. The JSONs can now be merged.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-06-25 00:49:42 -04:00
09eea3c8cd Add caching layer to WI save/load 2023-06-24 23:57:44 +03:00
747f7829fd Import Risu lorebooks 2023-06-24 23:34:36 +03:00
f360706227 Post-activation sorting of WI entries 2023-06-24 20:54:56 +03:00
9f0530f422 Export characters with world info embeds. 2023-06-23 22:50:16 +03:00
97e1585152 Import Agnai memory book JSON 2023-06-23 21:43:14 +03:00
01b4e1dae3 Import Novel PNG lorebooks 2023-06-23 19:20:58 +03:00
2302785242 #502 Import Novel Lorebooks (JSON-based) 2023-06-23 18:43:11 +03:00
ad779129d3 /world to set/unset active world 2023-06-23 16:51:15 +09:00
2f497cf25b Drag-sortable WI entries. 2023-06-22 20:11:29 +03:00
4d299916be Convert and import v2 character book embeds 2023-06-21 18:50:34 +03:00
012f0237db Don't change active WI selection on import 2023-06-21 12:23:14 +03:00
3723ae840f Use proportional WI budget. Add None option for WI editor. 2023-06-20 22:11:01 +03:00
df184bd46a Split WI editor and global WI select 2023-06-20 17:52:40 +03:00
2663a8370f (Internal refactor) Decouple world info editor from global WI selector 2023-06-20 13:47:34 +03:00
3b66310dd2 fix WI2AN insertions 2023-06-20 17:59:01 +09:00
f51af31850 Fix duplicating entries if char and global WI are the same 2023-06-19 02:19:42 +03:00
7e975e9df0 (WIP) Assign World Info to a character. [Out of spec] 2023-06-19 01:59:09 +03:00
58a6ccd4a5 WI-to-AN for real this time. 2023-06-18 18:17:43 +09:00
75090c4fa4 WorldInfo can now be routed into Author's Note 2023-06-18 08:27:24 +09:00
db7578be8e toggle for hiding WI Entry memo input box 2023-06-16 23:00:02 +09:00
7686ac0b28 fix WI open/close buttons + entries start closed 2023-06-16 19:24:24 +09:00
8b8bf645eb World Info: Allow disabling recursion on entries
Recursive scanning is a very great tool used to create a tree hierarchy
of entries. However, some entries should not be included in recursion
due to possible conflicts and resulting leakage in chats.

Add an individual opt-out toggle to exclude the entry from recursive
scanning if the main option is enabled.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-06-14 23:00:37 -04:00
74c676d6d8 Adjust saving and token counting debouncing rates of World Info 2023-06-14 00:44:57 +03:00
dbad870d98 #386 Match whole word option for world info 2023-06-08 22:03:49 +03:00
285d3e3d4a Fix LLAMA tokenization. Add case-sensitive WI matching 2023-05-21 00:40:13 +03:00
1253d04561 Merge branch 'main' into dev 2023-05-21 00:10:26 +03:00
299b9a04bc Replace info popups with toasts 2023-05-20 23:59:39 +03:00
e58360a4b4 subsitute user and char variable in world info keywords 2023-05-21 02:03:09 +05:30
c3fe796059 World Selector&Editor Combined/Lockable/Swappable 2023-05-15 09:27:03 +09:00
c5d53f9134 fix heights for WI 2ndary / SD prefix/neg inputs 2023-05-07 00:09:02 +09:00
f1f150e5d1 -fix WI entry 2ndary key height
-initHeight and resetHeight functions moved from WI to utils
2023-05-06 21:28:24 +09:00
19a4534d78 #230 Make recursive scanning of WI entries optional 2023-05-04 20:28:01 +03:00
370033f857 fixed WI entry secondary height 2023-05-04 23:09:54 +09:00
6d96b23dcc fixed WI entry scroll auto-height adjustments 2023-05-04 22:45:06 +09:00
b7e8d01694 AI config panel cleanup/styling
- editable inputs styled
- moved API model selectors from AIConfig to API Panel
- nicer WI Entry footer spacing
- corrected WI Entry textarea height calculations
- centered send_textarea placeholder
.mes_text now wraps anywhere to prevent long strings from overflowing-X
- placeholders added to a few inputs
2023-05-04 16:26:49 +09:00
74a11eaecc Fix deletion of world info file on empty rename 2023-05-01 21:26:51 +03:00
5144ae2220 Simplify logic of disabling the WI entry 2023-05-01 17:43:27 +03:00