Compare commits

..

1030 Commits

Author SHA1 Message Date
Cohee
74e5e0e4c0 Merge pull request #1404 from SillyTavern/staging
Staging
2023-11-26 20:38:50 +02:00
Cohee
3eeb137416 Fix persona switch input trigger 2023-11-26 19:56:19 +02:00
Cohee
f04c277f03 Add optional {{mesExamples}} to story string 2023-11-26 19:47:23 +02:00
Cohee
e587f208be Add resolution match on load 2023-11-26 18:19:37 +02:00
deffcolony
aaeaa643e3 resolution presets for image generation extension (#1394)
+ New drawer with resolution presets at image generation extension

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2023-11-26 17:55:49 +02:00
Cohee
9c01a849cb Add buttons command 2023-11-26 17:05:55 +02:00
Cohee
fb08552d46 Add instruct mode sequence macros 2023-11-26 16:37:05 +02:00
Cohee
3bc91f10ec Fix command aliases 2023-11-26 15:47:11 +02:00
Cohee
19f758a0fb #670 Add square avatars 2023-11-26 15:27:54 +02:00
Cohee
e6c96553d0 Add text trimming commands 2023-11-26 13:55:22 +02:00
Cohee
7b3f2a8986 Fix readme config reference 2023-11-26 13:19:40 +02:00
Cohee
87108421b3 Add default config values 2023-11-26 13:13:44 +02:00
Cohee
809a55b2fd Merge branch 'config-yaml' into staging 2023-11-26 13:08:06 +02:00
Cohee
c328d6f04a Add QR auto-exec on app startup 2023-11-26 02:12:31 +02:00
Cohee
9587a704c5 Fix docstrings 2023-11-26 01:52:41 +02:00
Cohee
283d49a6ee Add empty return value to /while 2023-11-26 01:49:37 +02:00
Cohee
c259c0a72a Skip hidden messages from /message command 2023-11-26 01:15:19 +02:00
Cohee
c6aea00e27 Resolve ephemeral stop strings variables 2023-11-26 00:56:55 +02:00
Cohee
50322ed8b0 Don't show auto-update toast if no extensions installed 2023-11-26 00:52:00 +02:00
Cohee
0648da8d05 Docker fix 2023-11-26 00:41:28 +02:00
Cohee
a7024a1d34 Migrate to config.yaml 2023-11-25 23:45:33 +02:00
RossAscends
df15a00430 resolve roll&random before parsing macro var commands 2023-11-26 06:27:13 +09:00
RossAscends
3ec692e76c fix /world unsetting function 2023-11-26 05:26:41 +09:00
Cohee
0bbaeeaedd Revert to get/set/add order for variable macro 2023-11-25 22:02:40 +02:00
Cohee
b24d4f2340 Add opt-in CORS bypass endpoint 2023-11-25 21:56:57 +02:00
Cohee
0410540066 Process variable macros line by line 2023-11-25 20:52:17 +02:00
Cohee
a5c3e22833 #1055 Add new random syntax to docs 2023-11-25 20:41:46 +02:00
Cohee
0d9068f11e Don't replace {{addvar}} macros with the execution result 2023-11-25 20:33:07 +02:00
Cohee
67fa9c9595 Allow dice rolls in {{random}} 2023-11-25 20:11:47 +02:00
RossAscends
a8dc4dc810 Merge branch 'staging' of https://github.com/Cohee1207/SillyTavern into staging 2023-11-26 03:08:05 +09:00
RossAscends
9645034b09 reverse compatibility for old random method 2023-11-26 03:08:03 +09:00
Cohee
67174c8cf8 Add functions to delete local and global variables 2023-11-25 19:53:00 +02:00
RossAscends
7264e3fe83 Merge branch 'staging' of https://github.com/Cohee1207/SillyTavern into staging 2023-11-26 01:28:35 +09:00
RossAscends
2bed9fde70 {{random}} split on :: to allow empty items & commas in items 2023-11-26 01:28:33 +09:00
Cohee
b8d7b0922d Fix evaluation order of named args 2023-11-25 18:18:57 +02:00
Cohee
d862005c1c Revert "Replace macros in named args of boolean evaluation"
This reverts commit 6894b7ef72.
2023-11-25 18:16:53 +02:00
Cohee
6894b7ef72 Replace macros in named args of boolean evaluation 2023-11-25 18:12:28 +02:00
Cohee
06ade803fa Concatenate strings in /addvar 2023-11-25 17:45:40 +02:00
RossAscends
389c2b5435 force firstMes {{user}} update on persona switch 2023-11-25 23:40:27 +09:00
Cohee
2c822f79f7 Merge pull request #1397 from aisu-wata0/claude_system_order_fix 2023-11-24 23:38:02 +02:00
Aisu Wata
a6898365d1 Claude system message order fix 2023-11-24 17:58:20 -03:00
Cohee
8e49ecce49 Merge pull request #1395 from daswer123/staging 2023-11-24 20:07:51 +02:00
Cohee
851a00630a Add /popup command 2023-11-24 19:50:49 +02:00
Danil Boldyrev
fbc72085f8 Hindi Support for XTTS 2023-11-24 20:16:49 +03:00
Cohee
4fd68e5be7 Skill issue 2023-11-24 19:10:09 +02:00
Cohee
a178bdc3b0 Fix ephemeral stopping strings flush 2023-11-24 19:06:31 +02:00
Cohee
2c8e855385 Resolve variables in /fuzzy 2023-11-24 17:41:49 +02:00
Cohee
adb3badcc1 Add /messages and /setinput commands 2023-11-24 17:12:59 +02:00
Cohee
c9b3ccc585 Add STscript procedure calls with /run command 2023-11-24 15:58:00 +02:00
Cohee
dd17c2483f Add lock=on/off to /gen and /genraw commands 2023-11-24 15:18:49 +02:00
Cohee
8e16f28827 Fix variable cast 2023-11-24 14:53:12 +02:00
Cohee
d81371c2b7 Fix variables casting 2023-11-24 14:44:11 +02:00
Cohee
bcf73e0e55 Add auto-execute on opening chat option to quick
reply settings
2023-11-24 14:02:04 +02:00
Cohee
f1d375c2ba Add hidden/invisible/auto-exec only QR buttons 2023-11-24 13:50:42 +02:00
Cohee
720da5649b Don't auto-exec on disable QR 2023-11-24 13:32:27 +02:00
Cohee
ad8709842b STscript improvements (see below)
Add /while loop
Add escaping of macros in sub-commands
Add /input prompt
2023-11-24 12:49:14 +02:00
RossAscends
55607ee847 remove HumiBlur from QR chain menus 2023-11-24 17:45:13 +09:00
RossAscends
0b9555234e sort ChatCompletion presets by name 2023-11-24 17:15:39 +09:00
Cohee
d3ea5c081d Add /pass and /fuzzy commands 2023-11-24 02:21:50 +02:00
Cohee
74fbc88d7d Move macros replacement to script execution time 2023-11-24 01:56:43 +02:00
Cohee
461e8d7929 Update the tooltip on the vertical ellipsis button 2023-11-24 01:39:39 +02:00
Cohee
e593dd4dbd Auto-executable QR 2023-11-24 01:32:02 +02:00
Cohee
7841f3d91f Merge pull request #1392 from LenAnderson/qr-context
Add context menus for Quick Replies
2023-11-24 01:04:24 +02:00
Cohee
c4e1fff1bc Respect # limit for ephemeral stop strings 2023-11-24 00:54:23 +02:00
Cohee
863554fea6 Add ephemeral stop strings to /genraw 2023-11-24 00:51:27 +02:00
Cohee
c2e3bfa06d /genraw instruct=off 2023-11-24 00:36:35 +02:00
Cohee
c50ed4bf6a STscript improvements (see below)
/abort command, {{pipe}} macro in named args, subcommand batch escaping with backslash, string literals and rules for /if, else clause for /if
2023-11-24 00:18:07 +02:00
Cohee
3594c4aac7 Add {{newline}} and {{pipe}} macros 2023-11-23 22:56:52 +02:00
Cohee
86819b6f4f Add /genraw command 2023-11-23 22:50:13 +02:00
Cohee
6d0982e823 Unleash the variables / STscript alpha 2023-11-23 22:36:48 +02:00
LenAnderson
ab9c654708 Merge branch 'staging' into qr-context 2023-11-23 20:35:21 +00:00
LenAnderson
cdbcd6cfb2 add a healthy dose of mobile copium 2023-11-23 20:34:20 +00:00
Cohee
3328df6076 Update readme.md 2023-11-23 21:15:22 +02:00
Cohee
6d4484c4d0 Merge pull request #1390 from Huge/patch-1
Update readme.md with node version check
2023-11-23 21:13:45 +02:00
Cohee
e48cd0a49d Fix version number + provide LTS guidance 2023-11-23 21:13:20 +02:00
Cohee
044cceba4d Merge pull request #1387 from aikitoria/add-manifest
Add manifest.json for Chrome Android / Add to Home Screen flow
2023-11-23 20:56:43 +02:00
Cohee
58eae43cb0 Merge branch 'release' into staging 2023-11-23 20:55:13 +02:00
Cohee
22e17cd681 Pass image type to thumbnail creator 2023-11-23 20:50:08 +02:00
LenAnderson
81f135fa7c use client coords not screen coords 2023-11-23 17:42:31 +00:00
LenAnderson
af2b108730 add context menu editor 2023-11-23 17:42:19 +00:00
LenAnderson
5e4dc388eb Merge branch 'staging' into qr-context 2023-11-23 15:57:35 +00:00
LenAnderson
d32224041a add parent placeholders 2023-11-23 15:57:14 +00:00
Huge
68370dbe30 Update readme.md with node version check
otherwise illegible error occurs
2023-11-23 14:55:32 +01:00
RossAscends
73d6801406 slashcommand /movingui to set a MUI preset 2023-11-23 22:32:47 +09:00
RossAscends
4f7c925dc6 properly round left menu borders 2023-11-23 22:10:23 +09:00
LenAnderson
e2a1892e6b Merge branch 'staging' into qr-context 2023-11-23 12:21:46 +00:00
LenAnderson
cc426e9897 add qr context menus 2023-11-23 12:21:25 +00:00
RossAscends
e0e303b339 Sortable QuickReplies 2023-11-23 19:49:15 +09:00
RossAscends
a88e2f93af Merge branch 'staging' of https://github.com/Cohee1207/SillyTavern into staging 2023-11-23 17:20:35 +09:00
RossAscends
e672a7fe99 'New Chat' in Manage Chats & showLoader when delChat-ing 2023-11-23 17:20:31 +09:00
Cohee
986ae263d3 Merge pull request #1389 from bdashore3/staging 2023-11-23 07:59:36 +02:00
kingbri
e445aeec14 Tabby: Fix model name return on error
Tabby's model API is always /v1/model/list, so return "None" if the
request fails since that means a model is most likely not loaded.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-11-23 00:13:28 -05:00
Cohee
b4afb10fab Change # of beams min value 2023-11-23 02:03:41 +02:00
Cohee
45b714fb9e Don't crash server if google translate fails 2023-11-23 00:59:34 +02:00
aikitoria
10716d1101 Add manifest.json for Chrome Android 2023-11-22 19:18:00 +01:00
Cohee
35349dd8d7 Hide page overflow 2023-11-22 17:59:46 +02:00
Cohee
f802fe1797 Fix xtts separator 2023-11-22 17:47:58 +02:00
Cohee
62d57e0a1a #1386 Fix PaLM API 2023-11-22 17:37:01 +02:00
Cohee
56b63c0e02 #1386 Fix PaLM API 2023-11-22 17:36:34 +02:00
Cohee
2b54bfd1d5 Merge pull request #1380 from LenAnderson/checkbox-contrast
ensure checkboxes have contrast
2023-11-22 16:52:48 +02:00
Cohee
6ea7987a44 Merge pull request #1385 from XXpE3/staging
Optimized the Chinese translation in i18n.
2023-11-22 16:47:51 +02:00
Cohee
57f303223b Don't add extra space on non-instruct continue 2023-11-22 16:34:25 +02:00
Cohee
73eeab9ace Don't display incomplete sentences in quiet-to-loud prompts if trim is enabled 2023-11-22 16:21:43 +02:00
Cohee
61908935f5 Stop string for user-continue. Trim spaces after name2 2023-11-22 16:16:48 +02:00
XXpE3
668a149898 Optimized the Chinese translation in i18n. 2023-11-22 13:41:46 +08:00
Cohee
55af72cb17 /addswipe command 2023-11-22 01:26:17 +02:00
Cohee
63e5bc9341 Merge branch 'staging' of https://github.com/SillyTavern/SillyTavern into staging 2023-11-22 00:58:08 +02:00
Cohee
4f7523b896 Parallelize extensions auto-update + add a toast 2023-11-22 00:58:06 +02:00
Cohee
59e558fba5 Don't execute commands on dry runs 2023-11-22 00:50:41 +02:00
RossAscends
0d84aed89c Merge branch 'staging' of https://github.com/Cohee1207/SillyTavern into staging 2023-11-22 07:48:40 +09:00
RossAscends
fe21a7c25b Add toggle for hiding muted group member sprites 2023-11-22 07:48:35 +09:00
Cohee
e5f7b0b5c7 Use explicit unnamed argument first if exists 2023-11-22 00:43:33 +02:00
Cohee
4b78ddbc8a First steps in slash command piping 2023-11-22 00:39:17 +02:00
Cohee
1b4d955aec Add swipe id validation for /delswipe 2023-11-21 23:33:20 +02:00
Cohee
284bd76589 Add /delswipe command 2023-11-21 23:28:11 +02:00
Cohee
2dc8f8f2f7 Add 5 group control commands 2023-11-21 22:35:59 +02:00
Cohee
df4ed389bf System prompt for Claude 2 2023-11-21 22:11:26 +02:00
Cohee
5f77b2f816 Add Claude 2.1 2023-11-21 20:07:37 +02:00
Cohee
1891a03b11 Merge pull request #1383 from daswer123/staging
Add support for the new TTS - XTTSv2
2023-11-21 16:26:45 +02:00
Cohee
73e081dd99 Don't use global state to build Chat Completion prompts 2023-11-21 14:38:15 +02:00
Danil Boldyrev
bcad0d4e51 add XTTS 2023-11-21 13:16:56 +03:00
LenAnderson
9f16b329c5 ensure checkboxes have contrast 2023-11-21 01:26:43 +00:00
Cohee
01b629bd49 New syntax for sendas command 2023-11-21 02:54:04 +02:00
Cohee
52d9855916 Code lint 2023-11-21 02:00:50 +02:00
Cohee
91429ce516 Merge pull request #1378 from LenAnderson/more-comfy-merge
Add more ComfyUI options
2023-11-21 01:55:00 +02:00
Cohee
ddbdceba64 Add sampler order for koboldcpp under text completions 2023-11-21 01:47:57 +02:00
Cohee
1ebfddf07e Use mistral and yi tokenizers for custom token bans 2023-11-21 01:04:27 +02:00
Cohee
9b75e49b54 Add support for Yi tokenizer 2023-11-21 00:21:58 +02:00
LenAnderson
1c725879d8 add func for loading dropdown opts for settings 2023-11-20 22:00:40 +00:00
Cohee
4222b2aa21 Add enable/disable group member commands 2023-11-20 23:49:04 +02:00
Cohee
f60e74fbd9 Fix message timer showing NaN in some cases 2023-11-20 22:53:51 +02:00
Cohee
ac4b673c5a Fix character name appending on user continue 2023-11-20 22:48:43 +02:00
LenAnderson
3d4442ab25 make api routes kebab 2023-11-20 18:27:50 +00:00
LenAnderson
8b5a56a99c use DIRECTORIES const for comfy workflow path 2023-11-20 18:26:13 +00:00
Cohee
cf853a21ad Merge pull request #1376 from bdashore3/staging
Secrets: Add find endpoint to retrieve a secret value (with conditions)
2023-11-20 19:12:24 +02:00
kingbri
6a511fdfcf Secrets: Add find endpoint
Requires the user to set allowKeysExposure to true before any calls
can work.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-11-20 12:05:54 -05:00
Cohee
e81c100e13 Merge pull request #1377 from LenAnderson/fix-popups
fix all popups being large/wide after first one
2023-11-20 18:25:01 +02:00
LenAnderson
46cc04c798 add default comfy workflow 2023-11-20 15:59:38 +00:00
LenAnderson
9c41a9d2ac fix merge duplicates 2023-11-20 15:58:48 +00:00
LenAnderson
18e6b8cd7c onelinefy 2023-11-20 12:56:52 +00:00
LenAnderson
d24c74e34a update comfy generate to use saved workflows 2023-11-20 12:51:36 +00:00
LenAnderson
777d105602 fix formatting 2023-11-20 12:40:27 +00:00
LenAnderson
06ececc1a5 add managing multiple comfy workflows 2023-11-20 12:39:06 +00:00
LenAnderson
5e5c111d25 add VAE selection 2023-11-20 12:34:37 +00:00
LenAnderson
d5b9dd34b7 remove unused comfy method 2023-11-20 12:29:47 +00:00
LenAnderson
1dd1cd69ac fix all popups being large/wide after first one 2023-11-20 12:16:37 +00:00
Cohee
6ddf8291e9 Merge pull request #1374 from ThisIsPIRI/help
Corrections to /help macros, /help format
2023-11-20 10:57:12 +02:00
Cohee
dd8deab4e3 Update colab 2023-11-20 03:21:26 +02:00
Cohee
af44a63265 Update colab 2023-11-20 03:15:47 +02:00
Cohee
41db1464a2 Update colab 2023-11-20 03:12:24 +02:00
ThisIsPIRI
d87e44ff03 Corrections to /help macros, /help format 2023-11-20 08:51:37 +09:00
Cohee
47a2734ad4 Merge pull request #1352 from chrisbennight/staging
update docker registry in compose file to github from dockerhub
2023-11-20 01:06:38 +02:00
Cohee
48034eb6c9 More info for mancer models 2023-11-19 23:01:39 +02:00
Cohee
ac07c8324d Configurable chat truncation amount 2023-11-19 21:57:54 +02:00
Cohee
a02446c4cc Cancel deletion mode on switching chats 2023-11-19 21:40:23 +02:00
Cohee
a39ee32f93 Horde fire and forget delete request 2023-11-19 21:30:08 +02:00
Cohee
9dcc23825a [chore] Reformat 2023-11-19 21:17:02 +02:00
Cohee
5e6fcd28b2 Merge pull request #1371 from LenAnderson/staging
Add ComfyUI to the Stable Diffusion extension
2023-11-19 21:14:42 +02:00
Cohee
9e3072f89b Explicitly add form-data to package.json 2023-11-19 21:05:58 +02:00
Cohee
96b87641ca Add OpenAI Whisper API 2023-11-19 20:30:34 +02:00
LenAnderson
9dd1e59421 move requests to comfy into ST server 2023-11-19 18:29:41 +00:00
Cohee
1f58d8c335 Merge pull request #1373 from eltociear/patch-2
Update readme.md
2023-11-19 18:28:15 +02:00
Cohee
de456fd097 #1372 Typical P unbreak 2023-11-19 18:27:33 +02:00
Cohee
8de343295d #1372 Typical P unbreak 2023-11-19 18:26:57 +02:00
Ikko Eltociear Ashimine
80161bf138 Update readme.md
minor fix
2023-11-20 01:18:50 +09:00
Cohee
96caddfd71 Add koboldcpp as Text Completion source 2023-11-19 17:14:53 +02:00
Cohee
1dc1b926c4 Fix TTS issues with streaming 2023-11-19 16:56:12 +02:00
Cohee
b0b19edf31 Add multimodal captioning for SD prompt generation 2023-11-19 15:24:43 +02:00
Cohee
c3e5d0f6f2 Adjust scroll height on image inserting 2023-11-19 14:32:36 +02:00
LenAnderson
fdccab3069 add ComfyUI 2023-11-19 12:18:48 +00:00
Cohee
81cb43004b Fix zoomed character avatar validation 2023-11-19 02:16:30 +02:00
Cohee
57165cbe48 Fix invalid SerpApi secret id 2023-11-19 01:41:39 +02:00
Cohee
211722d67b Bump package version 2023-11-19 01:34:24 +02:00
Cohee
685bb9742e Fix update button icons 2023-11-19 01:33:54 +02:00
Cohee
53c3fc16c1 Assorted SD fixes 2023-11-19 00:40:21 +02:00
Cohee
b6936584fe Extend chat comps response limit 2023-11-18 23:39:59 +02:00
Cohee
3f5728d67a Fix TTS not playing if the last message was generated quietly 2023-11-18 23:37:11 +02:00
Cohee
ddeb42ba55 Close modal send form menus when clicking on button again + fix caption UI labels 2023-11-18 21:17:53 +02:00
Cohee
4999fbd97c Check for API key in multimodal captions 2023-11-18 20:58:04 +02:00
Cohee
7045d242e8 Add ability to attach files and images to messages 2023-11-18 19:24:55 +02:00
Cohee
73660c7bef Merge pull request #1364 from LenAnderson/staging 2023-11-18 14:16:10 +02:00
LenAnderson
e520a50de2 add autorun command line argument 2023-11-18 00:09:42 +00:00
Cohee
6f9be2eee9 Merge branch 'staging' of https://github.com/SillyTavern/SillyTavern into staging 2023-11-17 23:19:25 +02:00
Cohee
0608c0afac Add OpenRouter and Llava to captioning plugin. 2023-11-17 23:19:21 +02:00
Cohee
b28ebf46b6 Merge pull request #1361 from bdashore3/staging
Add support for TabbyAPI
2023-11-17 22:02:34 +02:00
kingbri
5f8c615981 Server: Fix model info logs
Don't use a formatted string.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-11-17 15:01:13 -05:00
kingbri
f7ed574d04 Tabby: Decouple combined conditionals
Done by request.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-11-17 14:51:44 -05:00
Cohee
a8c819e293 Minor spelling mistake 2023-11-17 19:32:34 +02:00
kingbri
4cfa267b1b API Tokenizer: Add support for TabbyAPI
Use Tabby's /v1/token endpoints.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-11-17 01:48:03 -05:00
kingbri
f31b996cb5 Text Generation: Add TabbyAPI support
TabbyAPI is an exllamav2 only API server that aims to provide a simple
experience for loading and chatting with exl2 models.

SillyTavern currently doesn't have the ability to load and unload models,
so only add the OAI compatible completion endpoints.

The repository can be found here:
https://github.com/theroyallab/tabbyAPI

Signed-off-by: kingbri <bdashore3@proton.me>
2023-11-17 00:37:39 -05:00
Cohee
323b338cdd Add images to quiet prompts if inlining enabled 2023-11-17 01:30:32 +02:00
Cohee
4b4880bf11 Merge branch 'release' into staging 2023-11-16 18:57:09 +02:00
Cohee
5289038dbd Merge pull request #1354 from Tony-sama/staging
Correct live2d model file parsing to handle non "model3" models
2023-11-16 18:55:49 +02:00
Cohee
f4630f9808 Add lastMessage macro. Substitute params in CFG negative prompts 2023-11-16 16:58:49 +02:00
Cohee
d114ebf6fa Add default role for Message class if not set. 2023-11-16 16:20:33 +02:00
Cohee
7781dae836 Add separator to colab cell 2023-11-16 14:32:09 +02:00
Cohee
72ad2c3261 Update colab 2023-11-16 14:27:09 +02:00
Cohee
e753246373 Add NAI Diffusion 3 model 2023-11-16 02:15:28 +02:00
Cohee
9e48d807cc Add slash command to set UI theme 2023-11-16 00:57:23 +02:00
Cohee
d72c4e0e3f Rename Text Generation WebUI to Text Completion 2023-11-15 23:58:16 +02:00
Cohee
9353ae7415 Merge pull request #1357 from Touch-Night/release 2023-11-15 22:31:34 +02:00
Lu Guanghua
74dec58e0d Update i18n.json 2023-11-16 02:17:09 +08:00
Cohee
3fb26d3927 Add lazy loading of sentencepiece tokenizers 2023-11-15 19:39:55 +02:00
Cohee
9199750afe Merge pull request #1356 from nonenothingnada/staging
Bugfix: World Info - NOT operator only considers first secondary key
2023-11-15 14:11:53 +02:00
nonenothingnada
bca21ec9b6 Bugfix: World Info - NOT operator only considers first secondary key
Small fix to correct the behavior of the World Info NOT operator with a list of secondary keys to what was (hopefully) intended. Previously only the first secondary key was ever checked. Now each primary key should be checked against each secondary key with a single match invalidating the entry activation.
2023-11-15 12:11:09 +01:00
RossAscends
42c73c8658 block mobile swipe gesture under fullscreen panels 2023-11-15 19:20:05 +09:00
RossAscends
88863262da remove console logs 2023-11-15 18:59:39 +09:00
RossAscends
d4a2502ec0 make zensliders ctx respect unlock state 2023-11-15 18:58:47 +09:00
Cohee
5136b70882 #1355 Update summary settings button to make it more visible 2023-11-15 02:16:42 +02:00
Cohee
3c3594c52f Add backup/restore for Personas 2023-11-15 02:09:40 +02:00
Cohee
3143356523 Skill issue 2023-11-15 01:16:31 +02:00
Cohee
5b5e42361a Fix chat backups saving with incorrect file extension 2023-11-15 01:06:27 +02:00
Cohee
22161c2264 Add backup/restore for tags 2023-11-15 00:59:44 +02:00
Cohee
9bef9f4332 Fix delete message without checkboxes 2023-11-15 00:27:46 +02:00
Cohee
f24aae546c Filter WI entries by tags 2023-11-14 23:54:08 +02:00
Cohee
dcf913336b Add macros for character's main and jailbreak prompts 2023-11-14 22:54:16 +02:00
Cohee
7be808c2ff Disable position select for system prompts 2023-11-14 22:41:47 +02:00
Cohee
314aca3f2c Allow disabling system marker prompts 2023-11-14 22:27:07 +02:00
Cohee
4277aac974 Don't prompt to create persona if replacing an image 2023-11-14 22:07:32 +02:00
Cohee
ea583e0ff5 Add fuzzy search to /bg command 2023-11-14 21:43:08 +02:00
Cohee
abb8b0f0cc Update hide / unhide commands to accept range 2023-11-14 21:37:37 +02:00
Cohee
c6ac4459a3 Move image inlining toggle. GPT-4V via OpenRouter 2023-11-14 21:19:39 +02:00
Cohee
b559187722 Autoset height of QR slots. Revert textarea padding 2023-11-14 12:48:55 +02:00
Cohee
50f3def2eb Decrease icon size and text padding 2023-11-14 11:36:57 +02:00
RossAscends
2f20c8e6da Merge branch 'staging' of https://github.com/Cohee1207/SillyTavern into staging 2023-11-14 15:53:28 +09:00
RossAscends
3f4a62d22c ext button to left, stack buttons on mobile 2023-11-14 15:53:26 +09:00
Cohee
1f736a051e Merge branch 'release' into staging 2023-11-14 01:34:04 +02:00
Cohee
c0a8186d37 Add assets and update symbolic links in Dockerfile and entrypoint script 2023-11-14 01:30:47 +02:00
Cohee
fc17f42f93 Change flag hint for ooba 2023-11-14 00:36:34 +02:00
Cohee
b6fb624c99 Change flag hint for ooba 2023-11-14 00:36:04 +02:00
Cohee
4e9b952116 Merge pull request #1354 from Tony-sama/staging
Correct live2d model file parsing to handle non "model3" models
2023-11-14 00:29:43 +02:00
Tony Ribeiro
a261c163a5 merging change to live2d assets listing 2023-11-13 23:22:19 +01:00
Tony Ribeiro
9169938448 Fix listing of live2d model file for non-model3 type models. 2023-11-13 23:20:36 +01:00
Cohee
5fe8f70eb1 #1345 Add API endpoint for web search interaction 2023-11-14 00:16:41 +02:00
Cohee
61764a9a21 Change mancer base URL via debug menu 2023-11-13 11:13:39 +02:00
RossAscends
52c07e0895 setup Aphrodite-specific API flag handling 2023-11-13 16:36:01 +09:00
Cohee
7bf62b3dad Merge pull request #1351 from SillyTavern/staging
Staging
2023-11-13 01:52:46 +02:00
Chris Bennight
690dc328c5 update docker registry in compose file to github from dockerhub 2023-11-12 18:52:34 -05:00
Cohee
25f1afa628 Fix lab mode class 2023-11-13 01:49:36 +02:00
Cohee
e29bcde1d3 Localization hotfix 2023-11-13 01:45:46 +02:00
Cohee
8ff4599e8a Merge branch 'release' into staging 2023-11-12 23:29:13 +02:00
Cohee
6c02a12e88 Proper manual input debounce 2023-11-12 23:28:34 +02:00
Cohee
8fd5a5886b #1347 Localization hotfix 2023-11-12 23:20:32 +02:00
Cohee
31d6c97e70 #1347 Localization hotfix 2023-11-12 23:20:14 +02:00
Cohee
d3e5f6ebc0 #1343 Move bypass check up 2023-11-12 23:08:24 +02:00
Cohee
aeac56c95d Reformat assets.js code 2023-11-12 23:02:07 +02:00
Cohee
2aaaa71d85 Merge branch 'staging' of https://github.com/SillyTavern/SillyTavern into staging 2023-11-12 22:38:55 +02:00
Cohee
500a1dc4c6 Merge pull request #1349 from Tony-sama/staging
update live2d assets detection to allow for subfolder organisation.
2023-11-12 22:38:49 +02:00
Cohee
0d4e5c31e2 Code clean-up 2023-11-12 22:35:17 +02:00
Cohee
9a1d1594d6 Fix formatting in openai.js 2023-11-12 22:14:35 +02:00
Cohee
cd440f6539 Merge pull request #1350 from artisticMink/feature/openrouter-grouping-and-sorting
Feature/openrouter grouping and sorting
2023-11-12 22:13:40 +02:00
Cohee
5bcd49b7ca More concise UI texts, fix button spam clicks 2023-11-12 22:12:16 +02:00
Cohee
2092f849f7 #1348 Show a full screen loader when bulk deleting characters 2023-11-12 21:58:43 +02:00
artisticMink
cc0b4e8174 Access oai_settings instead of dom 2023-11-12 20:55:29 +01:00
Cohee
6e9c6a14f7 Update index.html 2023-11-12 20:35:53 +02:00
Tony Ribeiro
f082420fc7 Use cross os separator for live2d assets path 2023-11-12 19:25:13 +01:00
Tony Ribeiro
c5ea3cfce7 normalize path of live2d assets 2023-11-12 19:21:01 +01:00
Tony Ribeiro
e7e4f75c86 fix new live2d asset listing for character folder. 2023-11-12 19:08:29 +01:00
artisticMink
3bbbf0d8e4 Put openrouter model sorting in drawer
Renames 'Infinity'k tokens to 'Free'
2023-11-12 19:02:41 +01:00
Tony Ribeiro
7f8994c1fd update live2d assets detection to allow for subfolder organisation. 2023-11-12 18:56:01 +01:00
artisticMink
cb2644cdea Add sorting for openrouter models
Alphabetically (default), price, context size
2023-11-12 18:27:56 +01:00
Cohee
dd12cacd16 Fix range validation error 2023-11-12 17:27:40 +02:00
RossAscends
4558f856b5 Merge branch 'staging' of https://github.com/Cohee1207/SillyTavern into staging 2023-11-12 23:57:54 +09:00
RossAscends
5e28d6f651 'off' labels for kobold, typable zenslider handles 2023-11-12 23:57:51 +09:00
artisticMink
a16e34bcef Add optional toggle for grouping openrouter models
By vendor
2023-11-12 15:15:30 +01:00
Cohee
822d9d72ea Force persona creation on avatar uploads. Don't show cropper for images if never resize is enabled. 2023-11-12 15:47:52 +02:00
Cohee
adc533070d Throttle silly animals to one change per minute 2023-11-12 13:26:38 +02:00
Cohee
7afe9e6481 #1343 Add status check bypass 2023-11-12 13:23:46 +02:00
Cohee
efe2a06976 Add null checks for OR pricing 2023-11-12 13:08:22 +02:00
Cohee
4c0b3fb7ae Add null checks for OR pricing 2023-11-12 13:07:57 +02:00
RossAscends
86caffb1c6 Ooba ZenSlider QoL: "Off" for disabled val sampler 2023-11-12 18:22:21 +09:00
RossAscends
583de0d0e7 Merge branch 'staging' of https://github.com/Cohee1207/SillyTavern into staging 2023-11-12 17:23:33 +09:00
RossAscends
986eef9830 fix zenslider and labmode compatibility check 2023-11-12 17:23:29 +09:00
Cohee
35c5d4e528 SD interactive mode fixes 2023-11-12 02:35:37 +02:00
Cohee
6f061adc1e Add OpenAI TTS provider 2023-11-12 02:28:03 +02:00
Cohee
a42c1fc581 Hide MinP under a feature flag. Send Miro to Horde 2023-11-12 01:12:14 +02:00
Cohee
59f7147271 Merge pull request #1342 from ThisIsPIRI/maxcontext
Fix context size counter when size is unlocked
2023-11-12 00:27:24 +02:00
Cohee
879502c1e7 Only allow inlining if OAI is the selected API 2023-11-12 00:13:30 +02:00
Cohee
2c4f53e7b5 Add native GPT-4V image inlining 2023-11-12 00:09:48 +02:00
ThisIsPIRI
ab5b0cb1db Fix context size counter when size is unlocked 2023-11-12 06:32:04 +09:00
Cohee
5d34c8aef5 Merge branch 'staging' of https://github.com/SillyTavern/SillyTavern into staging 2023-11-11 21:53:15 +02:00
Cohee
10264367aa WI editor visual QoL 2023-11-11 21:53:11 +02:00
Cohee
25b549b034 WI custom order (slight return) 2023-11-11 20:16:57 +02:00
Cohee
30f723d9fc Bump package version 2023-11-11 18:26:20 +02:00
Cohee
f79eaa4c8b Merge branch 'staging' of https://github.com/SillyTavern/SillyTavern into staging 2023-11-11 18:25:47 +02:00
Cohee
91a1cc81a0 #1242 Add aux field selector 2023-11-11 18:25:43 +02:00
Cohee
09ebbff30d Merge pull request #1341 from SillyTavern/staging
Staging
2023-11-11 16:51:08 +02:00
Cohee
f1d0e39d39 Require a name for dummy personas 2023-11-11 16:39:54 +02:00
Cohee
8a8880fca1 Visual touch-up 2023-11-11 16:31:13 +02:00
Cohee
28bb5db04f Add new settings to default/settings.json. 2023-11-11 16:21:20 +02:00
Cohee
21fec42172 Merge pull request #1339 from majick/supertemp
Increase kobold max temp to 4.0
2023-11-11 16:14:23 +02:00
Cohee
a02504381a Forbid trigger command while the group is generating 2023-11-11 16:12:02 +02:00
Cohee
303026e01f Nested bogus folders + back button 2023-11-11 14:53:08 +02:00
majick
b445d549db Increase kobold max temp to 4.0
Not only is a higher temp accepted by the back end, but it's just about necessary
in order to make use of Minimum P sampling.
2023-11-10 18:49:53 -08:00
Cohee
5331b5dc8a Fix npm audit 2023-11-10 23:54:44 +02:00
Cohee
7e2ec3ea43 Disable bulk edit for bogus folders 2023-11-10 22:18:48 +02:00
Cohee
066f74ed46 Fix grid view for bogus folders 2023-11-10 22:02:27 +02:00
Cohee
cb1e254cb9 Add tags as folders display mode 2023-11-10 21:56:25 +02:00
Cohee
abe4bb6d54 Add error handling for empty Palm response 2023-11-10 15:55:49 +02:00
Cohee
cfba379777 Hide injection depth input block for relative position 2023-11-10 15:36:42 +02:00
Cohee
0cb9dc2f0b Don't send empty list of bad_word_ids to Novel 2023-11-10 15:07:19 +02:00
Cohee
9a3d239e6d Add error handing for managing extensions 2023-11-10 10:25:34 +02:00
RossAscends
024581de84 dont gaslight user to click zenSlider numbers 2023-11-10 16:31:47 +09:00
RossAscends
dfb8a85eed let loose the Mad Labs 2023-11-10 16:17:38 +09:00
Cohee
2f5e7778cc Don't add items of unknown type to chat completion 2023-11-10 01:08:18 +02:00
Cohee
4e55126606 Replace the link to Turbo tokenizer 2023-11-10 00:57:36 +02:00
Cohee
3cc8d982d5 Move regenerate up in the list 2023-11-10 00:55:39 +02:00
Cohee
bc2b3e9c4e Merge pull request #1337 from artisticMink/hotfix/bulk-edit-enhanced
Fixes for bulk editing overlay
2023-11-10 00:10:27 +02:00
Cohee
3a5cd5d202 Close context menu if open when clicking on group 2023-11-10 00:04:16 +02:00
Cohee
7385de8cf8 Adjust position if context menu is outside of viewport 2023-11-09 23:55:14 +02:00
Cohee
e6fcefd4d1 Fix adding duplicate tags via bulk menu 2023-11-09 23:41:26 +02:00
Cohee
1f89e5a02a Merge branch 'release' into staging 2023-11-09 23:30:12 +02:00
Cohee
eb8cd900fa Merge pull request #1338 from smirgol/bugfix/tts-continue-or-deletion-of-chat-retriggers-tts
fix tts re-trigger for complete/autocomplete/delete
2023-11-09 23:28:17 +02:00
Cohee
34df781699 Make checkboxes brighter than text 2023-11-09 22:50:25 +02:00
Cohee
81fe9aa699 Fix updated tokenization via ooba API 2023-11-09 19:39:08 +02:00
Cohee
3780321ae6 Fix ooba model name displaying as turbo 2023-11-09 19:27:19 +02:00
artisticMink
b2b4be5452 Fix documentation typo 2023-11-09 15:24:24 +01:00
artisticMink
b56fb69eca Prevent deselecting of pointer target character on menu close 2023-11-09 15:18:59 +01:00
artisticMink
2f7e34f66c Close context menu when tapping on character 2023-11-09 15:03:49 +01:00
artisticMink
2174eb8149 Add i18n attributes to context menu 2023-11-09 15:02:56 +01:00
RossAscends
0a409c8c54 Kobold zenSlider, sampler reordering, HTML cleanup 2023-11-09 18:31:44 +09:00
RossAscends
19c5aca404 no more mid-edit swipes 2023-11-09 14:40:14 +09:00
Cohee
d9d61e479d Bypass generation for QR slash commands 2023-11-09 03:19:57 +02:00
Cohee
f2a96427a8 TTS: add slash command to speak 2023-11-09 02:57:40 +02:00
Cohee
ca1c0e35b1 TTS: force speak on first message in new chat 2023-11-09 01:30:54 +02:00
Cohee
0e89bf90bc Use correct tokenizers for logit bias for Mistral and Llama models over OpenRouter 2023-11-09 01:03:54 +02:00
Cohee
1f36fe5193 Fix weird display of macros in help command 2023-11-08 23:56:58 +02:00
Cohee
9aada5837f Fix opening chats in manage chats for export and deletion. 2023-11-08 23:50:25 +02:00
Cohee
9667b82599 Fix /del command (for real this time) 2023-11-08 23:42:44 +02:00
Cohee
aae8707460 Tiny spelling mistake 2023-11-08 23:30:38 +02:00
Cohee
bfbdb9f058 Fix /del command 2023-11-08 23:27:03 +02:00
Cohee
76b8880972 Normalize response statuses 2023-11-08 23:20:55 +02:00
Cohee
6dc5906229 Add ranges to /cut slash command 2023-11-08 23:04:32 +02:00
artisticMink
798099aaaf Prevent context menu from overlapping popup 2023-11-08 21:30:26 +01:00
artisticMink
fa452e94b0 Prevent loss of selected characters when closing menu 2023-11-08 21:22:00 +01:00
artisticMink
b8540a190b Prevent groups from being clicked.
Includes visual indication.
2023-11-08 20:52:34 +01:00
artisticMink
7e3c155e37 Unify access to character block container 2023-11-08 19:29:50 +01:00
smirgol
4f0935c494 better deep clone of message object. re-initalize ttsLastMessage after changing chats 2023-11-08 19:08:42 +01:00
Cohee
606f2bd9bb Allow deleting the first message 2023-11-08 19:55:54 +02:00
artisticMink
b7b478eea8 Cancel long-press on mouseup, touchend
Fixes menu opening multiple times in different position when a user selects quickly and ends with a long-press.
2023-11-08 18:48:35 +01:00
Cohee
480099ee97 Mancer will work in legacy API mode. Remove Soft Prompt mentions. 2023-11-08 18:16:47 +02:00
Cohee
2a5a780f3b Clarify ooba streaming error text 2023-11-08 18:01:41 +02:00
Cohee
3632a01e36 Adjust checkbox text alignment 2023-11-08 17:56:22 +02:00
Cohee
738c1d82c4 Clarify legacy API notification 2023-11-08 17:54:08 +02:00
smirgol
91266c831c fix tts re-trigger for complete/autocomplete/delete
fix re-trigger tts from start if text was added to chat by auto-continue
fix re-trigger tts from start if text was added by continue button
fix re-trigger of tts when message(s) got deleted
2023-11-08 16:40:47 +01:00
Cohee
4f1dbaa34b Remove /v1 from the ooba API URLs 2023-11-08 17:09:33 +02:00
Cohee
d81354e2a5 Merge branch 'staging' of https://github.com/SillyTavern/SillyTavern into staging 2023-11-08 16:29:02 +02:00
Cohee
dbf995fd24 Add character card macros 2023-11-08 16:28:55 +02:00
RossAscends
d8fd4c4767 Merge branch 'staging' of https://github.com/Cohee1207/SillyTavern into staging 2023-11-08 23:24:30 +09:00
RossAscends
a5fd33d08a Kobold sampler restyle 2023-11-08 23:24:28 +09:00
Cohee
d144831569 #1332 Fix group chat branching 2023-11-08 13:26:50 +02:00
Cohee
8f812d6a19 Add more aliases to image slash command 2023-11-08 12:08:13 +02:00
Cohee
740f6548a2 Increase timeouts of OAI out of quota requests 2023-11-08 12:07:14 +02:00
Cohee
b3ced2c4c5 Rename SD extension to "Image Generation" 2023-11-08 10:57:37 +02:00
Cohee
cbc0b41773 Prevent doubled legacy toast 2023-11-08 10:28:02 +02:00
Cohee
b6d29d2980 Return force /api append for Legacy ooba with relaxed URL off 2023-11-08 10:25:49 +02:00
Cohee
e76c18c104 Legacy ooba API compatibility shim 2023-11-08 10:13:28 +02:00
RossAscends
a98c275445 Merge pull request #1335 from bdashore3/staging
Chats: Fix past chat fetching
2023-11-08 14:48:36 +09:00
RossAscends
14ad73872b Merge pull request #1334 from majick/minp-precision
Increase the precision of the Min P slider and counter.
2023-11-08 14:47:00 +09:00
kingbri
8155b1c365 Chats: Fix past chat fetching
Includes checks if an element of the array includes a character ID,
but the array contains characters. We want to check if the value
at the specified index exists in the first place.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-11-08 00:46:26 -05:00
RossAscends
00c029a65a only api format for ooba, more visible checkboxes 2023-11-08 14:08:51 +09:00
majick
24ed0ea186 Increase the precision of the Min P slider and counter.
The most useful values of Min P are very low, between 0.01 and 0.05.
With a precision of 0.1, users have very few usable values to choose
from, while the back end can accept an arbitrary float.
2023-11-07 19:59:32 -08:00
Cohee
865256f5c0 Fix ooba tokenization via API. Fix requiring streaming URL to generate 2023-11-08 03:38:04 +02:00
Cohee
b2629d9718 Refactor status checks and indicators. 2023-11-08 02:52:03 +02:00
Cohee
00a1eaab28 Add timeout for status check 2023-11-08 01:47:31 +02:00
Cohee
44f77f3bb3 Fix mobile scrolling. Increase press timeout. Cancel longpress on scroll 2023-11-08 01:10:51 +02:00
Cohee
48e41d89cb Only override context menu if clicking within character block 2023-11-08 00:59:09 +02:00
Cohee
bda15ef007 Adjust aphro streaming error parser 2023-11-08 00:25:06 +02:00
Cohee
2c7b954a8d #1328 New API schema for ooba / mancer / aphrodite 2023-11-08 00:17:13 +02:00
Cohee
2d2ff5230c Merge pull request #1318 from artisticMink/feature/bulk-edit-enhanced
Feature/bulk edit enhanced
2023-11-07 20:47:06 +02:00
Cohee
0a0382def2 Decrease delay to open bulk edit 2023-11-07 20:46:22 +02:00
Cohee
bea3b5d720 Re-render character list when done editing. Decrease margin to prevent accidental clicks 2023-11-07 20:43:24 +02:00
Cohee
956a80f082 Add rounding for scroll adjustment value 2023-11-07 20:16:33 +02:00
Cohee
94cf4699e6 Fix neo slider z-fighting in Firefox 2023-11-07 17:03:49 +02:00
Cohee
2639548bdb Adjustable caption prompt and template 2023-11-07 01:58:34 +02:00
Cohee
9698c94ee2 #1324 Add captions via OpenAI and Horde 2023-11-07 01:28:46 +02:00
Cohee
2020d12217 Add new GPT 3.5 turbo model 2023-11-07 00:10:32 +02:00
Cohee
2018a6d94a #1325 Increase precision for Novel typical sampler 2023-11-06 23:43:30 +02:00
Cohee
fb5fa8de7c #1325 Increase precision for typical sampler 2023-11-06 23:40:09 +02:00
Cohee
9b0ac48cda Add GPT-4 preview model 2023-11-06 23:29:45 +02:00
Cohee
78e1df28c1 #1325 Increase precision on freq/pres pen for Novel 2023-11-06 23:03:22 +02:00
Cohee
41211137fe #1325 Revert precision changes on some KAI/NAI sliders 2023-11-06 22:58:04 +02:00
Cohee
568f352cf6 [WIP] Placeholder for built-in chat variables 2023-11-06 22:50:32 +02:00
Cohee
1896732f17 Add DALL-E to OpenAI plugin 2023-11-06 21:47:00 +02:00
Cohee
57e845d0d7 Resolve best match tokenizer for itemization. Adjust styles of token counter 2023-11-06 20:25:59 +02:00
Cohee
1a3f100018 Move stop strings post-processing up 2023-11-06 19:19:34 +02:00
artisticMink
dbc7f460e4 Change class name for coherence 2023-11-06 17:20:18 +01:00
artisticMink
a0f828a2da Do not delete selected characters on cancel 2023-11-06 16:13:34 +01:00
artisticMink
581a1e485b Add cursor pointer to characters and groups 2023-11-06 16:13:34 +01:00
artisticMink
6c81cc32e4 Optimization for mobile browsers 2023-11-06 16:13:34 +01:00
artisticMink
3b6e93fc0e Improve visuals in list mode 2023-11-06 16:13:34 +01:00
artisticMink
99ee1b887a Add documentation
Minor refactoring
2023-11-06 16:13:34 +01:00
artisticMink
36cf68a9f4 Sequentially handle persona conversions
Fixes popup overrides.
2023-11-06 16:13:34 +01:00
artisticMink
d2bc1e12c3 Make overlay work with legacy bulk delete button 2023-11-06 16:13:34 +01:00
artisticMink
2d42882a4b Deselect on select state exit 2023-11-06 16:13:34 +01:00
artisticMink
c584da2ea9 Accept both v1 and v2 spec for editcharacterattributes endpoint 2023-11-06 16:13:34 +01:00
artisticMink
42d838a0b3 Refactor TavernCardValidator error property 2023-11-06 16:13:34 +01:00
artisticMink
a876d098fe Skip handleDeleteCharacter when character is undefined 2023-11-06 16:13:34 +01:00
artisticMink
c3ff146dd2 Add bulk tagging 2023-11-06 16:13:34 +01:00
artisticMink
545d933e15 Revert "Add create deck functionality to context menu"
This reverts commit 015c83ae
2023-11-06 16:13:34 +01:00
artisticMink
f1de1d4b77 Restrict longpress start to left mouse button 2023-11-06 16:13:34 +01:00
artisticMink
27bc93936f Tint bulk edit button when bulk edit state is select 2023-11-06 16:13:34 +01:00
artisticMink
778eb2be0e Refactor CharacterGroupOverlay to BulkEditOverlay 2023-11-06 16:13:34 +01:00
artisticMink
e4da7d2a69 Add create deck functionality to context menu 2023-11-06 16:13:34 +01:00
artisticMink
7f6b6615ab Refactor character click handling into method 2023-11-06 16:13:34 +01:00
artisticMink
6eb6527d11 Prototyping 2023-11-06 16:13:34 +01:00
RossAscends
0effbebae7 tokenizer colorization underpinnings (inactive) 2023-11-06 18:04:47 +09:00
Cohee
dc1abed9c6 Fix loader blocking onboarding flow on first run 2023-11-06 10:23:47 +02:00
RossAscends
7a961ca6f6 fix zenslider race condition on F5 value loading 2023-11-06 17:12:47 +09:00
RossAscends
abef26974c tooltipify KAI Ban EOS token hint 2023-11-06 13:45:29 +09:00
RossAscends
8c368bda55 format KAI tooltips 2023-11-06 13:33:38 +09:00
RossAscends
bcc2edd926 Merge pull request #1319 from kalomaze/tooltips-samplers
Tooltips added to KAI Samplers
2023-11-06 13:18:10 +09:00
Cohee
e8ba328a14 Add text chunks display to token counter 2023-11-06 02:42:51 +02:00
Cohee
f248367ca3 Add Mistral tokenizer 2023-11-06 01:26:13 +02:00
RossAscends
c3479b23d9 Merge branch 'staging' of https://github.com/Cohee1207/SillyTavern into staging 2023-11-06 06:54:47 +09:00
RossAscends
37a89d280c restore newbie hides for reorganized ooba settings 2023-11-06 06:54:46 +09:00
Cohee
5c356ab177 Add confirmation to regex deletion 2023-11-05 23:44:28 +02:00
RossAscends
c520ad212a Merge branch 'staging' of https://github.com/Cohee1207/SillyTavern into staging 2023-11-06 06:42:27 +09:00
RossAscends
02b25d080f ooba sliders HTML unified, zensliders optimized 2023-11-06 06:42:13 +09:00
Cohee
4af6955588 Restyle regex script toggles 2023-11-05 23:40:43 +02:00
Cohee
5e88edf22d Merge pull request #1288 from LammyShark/staging
Toggle Regex Script Checkboxes
2023-11-05 23:18:23 +02:00
Cohee
248aec4885 Allow HTML font color overrides
(props to umbrastel)
2023-11-05 22:58:03 +02:00
Cohee
fd9c8b86e9 Token counter layout adjust 2023-11-05 22:55:10 +02:00
Cohee
13d8ec5768 #1317 Rename collapse newlines option 2023-11-05 22:51:16 +02:00
Cohee
f0c0949aa0 Add token ids viewer to tokenizer plugin 2023-11-05 22:45:37 +02:00
Cohee
632d55f6af Merge branch 'staging' of https://github.com/SillyTavern/SillyTavern into staging 2023-11-05 22:03:28 +02:00
Cohee
21e0a42060 Fix arch in models list, remove log 2023-11-05 22:03:20 +02:00
RossAscends
f1eaa18831 Merge branch 'staging' of https://github.com/Cohee1207/SillyTavern into staging 2023-11-06 05:01:17 +09:00
RossAscends
912ea8017f better stepping on ZenSliders amount_gen slider 2023-11-06 05:01:15 +09:00
Cohee
c1e126985d Merge branch 'staging' of https://github.com/SillyTavern/SillyTavern into staging 2023-11-05 21:54:23 +02:00
Cohee
fedc3b887f Add llama2 tokenizer for OpenRouter models 2023-11-05 21:54:19 +02:00
kalomaze
5d77a60939 Kobold tooltips for samplers + temp 2023-11-05 13:47:53 -06:00
Cohee
da4c88f7ec Merge branch 'staging' of https://github.com/SillyTavern/SillyTavern into staging 2023-11-05 19:55:57 +02:00
Cohee
c5e13f3f64 Disable zen sliders on first pull 2023-11-05 19:55:53 +02:00
RossAscends
cf81bd038a Merge branch 'staging' of https://github.com/Cohee1207/SillyTavern into staging 2023-11-06 02:46:21 +09:00
RossAscends
1b8389c8b8 update checkbox and slider styles 2023-11-06 02:46:19 +09:00
Cohee
22ce54649d Cut enc.rep.pen slider name 2023-11-05 19:41:04 +02:00
Cohee
5120cf38f0 Fix macros in first message with alt.greetings 2023-11-05 19:14:17 +02:00
Cohee
583c737106 #1313 Transparency for zoomed avatars 2023-11-05 19:01:48 +02:00
Cohee
ebe5f355d3 Fix formatting of hidden messages 2023-11-05 18:34:11 +02:00
RossAscends
304aa38f24 fix retrieval of currentChatID for renamed chars 2023-11-06 01:23:34 +09:00
RossAscends
a5b5dfdcb6 temperature last for ooba 2023-11-05 23:50:07 +09:00
RossAscends
937c5d7e5f Min P for Ooba, fix preset loading for ZenSliders 2023-11-05 23:08:06 +09:00
RossAscends
19c0100983 finally add theme styles to checkboxes 2023-11-05 15:47:29 +09:00
Cohee
a1b943dbbc Delete itemized prompts on chat deletion 2023-11-05 02:35:44 +02:00
Cohee
88df8501b3 Fix continue on forced OR instruct. Display proper itemized prompt 2023-11-05 02:20:15 +02:00
Cohee
06d5675d6f Fix Novel icon color 2023-11-04 23:57:24 +02:00
Cohee
b15aabf1f8 Merge branch 'staging' of https://github.com/SillyTavern/SillyTavern into staging 2023-11-04 23:25:26 +02:00
Cohee
36c627bd1b Save itemized prompts between sessions 2023-11-04 23:25:22 +02:00
RossAscends
b369be9201 Merge branch 'staging' of https://github.com/Cohee1207/SillyTavern into staging 2023-11-05 05:47:55 +09:00
RossAscends
1c35ff4f3d WIP ZenSliders (ooba only) 2023-11-05 05:47:53 +09:00
Cohee
2f9b247c46 Merge pull request #1307 from aisu-wata0/regexScript_promptOnly
Regex script: prompt only checkbox
2023-11-04 22:37:41 +02:00
Cohee
8183849fe4 Add more aliases for /help pages 2023-11-04 21:35:50 +02:00
Aisu Wata
4bdfd9d164 Regex script: promptOnly modifies coreChat 2023-11-04 15:14:59 -03:00
Cohee
4dccd4a053 Show app loader on start 2023-11-04 20:06:13 +02:00
Cohee
2d3fb08638 Add filter for missing WI entries 2023-11-04 20:02:38 +02:00
Cohee
81e52fb77c Display error when chat info couldn't be loaded 2023-11-04 18:49:06 +02:00
Cohee
9181747939 Update link to sampler parameters doc 2023-11-04 18:18:30 +02:00
Cohee
00cc0483f7 Fix input behavior 2023-11-04 17:48:55 +02:00
Cohee
890ae4bba9 Optimize WI layout 2023-11-04 17:44:43 +02:00
Cohee
b897c8db4a Merge pull request #1303 from aisu-wata0/world_info_minimum
New optional setting: World info: minimum activations
2023-11-04 17:12:58 +02:00
Cohee
e1e472bf79 Add {{lastMessageId}} macro, make async slash command handlers wait for completion 2023-11-04 13:33:09 +02:00
Cohee
b3669afea3 Put /help command on top 2023-11-04 12:37:13 +02:00
RossAscends
0bc6f369b8 Merge branch 'staging' of https://github.com/Cohee1207/SillyTavern into staging 2023-11-04 11:16:14 +09:00
RossAscends
447c43c9d7 placeholders for Aphro samplers 2023-11-04 11:16:12 +09:00
Cohee
6067b2f913 Add autocomplete for slash commands 2023-11-04 01:21:20 +02:00
Aisu Wata
4ec40d575e Regex Scritpt: Only Format Display: fixed typo on subtitle 2023-11-03 18:55:27 -03:00
Cohee
eab25c73e7 Hide/unhide messages 2023-11-03 23:45:56 +02:00
Aisu Wata
c94962aa3c Regex script: promptOnly checkbox and feature 2023-11-02 19:52:33 -03:00
Cohee
f10833a516 Add prompt format override for OpenRouter 2023-11-03 00:34:22 +02:00
Cohee
814c62cc21 Merge branch 'staging' of https://github.com/SillyTavern/SillyTavern into staging 2023-11-02 23:37:25 +02:00
Cohee
35a181e493 Shorten setting names 2023-11-02 23:36:54 +02:00
Cohee
a1df95592c Merge branch 'staging' of https://github.com/SillyTavern/SillyTavern into staging 2023-11-02 20:05:44 +02:00
Cohee
e6ccc53054 BG icon no longer stays in front of moving UI 2023-11-02 20:05:41 +02:00
RossAscends
bb594ebc30 placeholder gui for new example chat parsing 2023-11-02 20:55:56 +09:00
RossAscends
75c6e74d41 support for min P on Kobold API 2023-11-02 14:53:57 +09:00
RossAscends
1966779ade Merge branch 'staging' of https://github.com/Cohee1207/SillyTavern into staging 2023-11-02 13:32:59 +09:00
RossAscends
adef199767 fix slider width on high zoom, restyle ? links 2023-11-02 13:32:57 +09:00
Cohee
c695f73586 Merge branch 'staging' of https://github.com/SillyTavern/SillyTavern into staging 2023-11-01 22:59:07 +02:00
Cohee
e8f4653a25 Add interactive mode for SD plugin 2023-11-01 22:58:59 +02:00
RossAscends
56ec7152d7 better width scaling for mobile Ooba sliders 2023-11-02 03:10:40 +09:00
RossAscends
0576262bb9 Merge branch 'staging' of https://github.com/Cohee1207/SillyTavern into staging 2023-11-02 02:53:53 +09:00
RossAscends
230ef417b6 Ooba sampler panel overhaul 2023-11-02 02:53:50 +09:00
Aisu Wata
3eaff02c2f World Info Min Activations: min max depth default unlimited 2023-11-01 14:36:20 -03:00
Aisu Wata
8533cff188 World info Min Activations: changed UI text 2023-11-01 14:17:30 -03:00
Aisu Wata
39e4a1cd99 World info Min Activations: fewer UI text 2023-11-01 14:15:15 -03:00
Aisu Wata
77bde48a48 World Info Min Activations: added UI & persistence & budget respect 2023-11-01 14:02:38 -03:00
Cohee
e9b8e5d4e9 Extend length limits on most textareas 2023-11-01 10:40:22 +02:00
RossAscends
610c9b9f24 update loader styling 2023-11-01 12:40:21 +09:00
Cohee
a0706fcfc8 Add loader UI component 2023-10-31 22:16:33 +02:00
Cohee
eb4e90c589 Save auto-input to QR 2023-10-31 12:27:40 +02:00
Aisu Wata
8203ebb835 world_info_min_activations 2023-10-30 18:55:32 -03:00
Cohee
d541558f15 Rearrange extensions panel 2023-10-30 21:47:32 +02:00
Cohee
43b06d7df5 Rename view past chats => manage chat files 2023-10-30 21:42:55 +02:00
Cohee
064d331110 Merge pull request #1301 from zgce/release
fix the deeplx for chinese parameter
2023-10-30 16:36:57 +02:00
yuxiang
0921cd6b9c fix the Chinese translation parameter error of deeplx 2023-10-30 22:31:52 +08:00
yuxiang
de77abe152 Merge branch 'release' of https://github.com/SillyTavern/SillyTavern into release
# Conflicts:
#	src/translate.js
2023-10-30 22:10:27 +08:00
yuxiang
31c5036724 Merge branch 'release' of https://github.com/SillyTavern/SillyTavern into release
# Conflicts:
#	src/translate.js
2023-10-30 21:58:10 +08:00
RossAscends
a27e7a139a Chat History Panel Overhaul, shorter filenames 2023-10-30 14:16:20 +09:00
Cohee
2a9250c937 Bump package version 2023-10-30 00:50:25 +02:00
Cohee
1b1f3e9e0c Unbreak CFG sliders 2023-10-29 23:56:25 +02:00
Cohee
68e60ff9ef Unbreak CFG sliders 2023-10-29 23:56:11 +02:00
Cohee
853cf20e6e Remove unreliable check for git installed
It will fail anyway if not installed
2023-10-29 23:46:56 +02:00
Cohee
ea36d34942 Remove unreliable check for git installed
It will fail anyway if not installed
2023-10-29 23:46:13 +02:00
Cohee
91862bff43 Fix double-emit of CHAT_CHANGED on /go command 2023-10-29 23:23:42 +02:00
Cohee
fadd92a6c3 Fix expressions sometimes getting stuck when switching chats 2023-10-29 23:15:40 +02:00
Cohee
9bff2762fc Align message top bar text 2023-10-29 23:15:22 +02:00
Cohee
7b6603614f Add API icons for aphrodite and mancer 2023-10-29 23:02:56 +02:00
Cohee
99e6ee2d4d Slash command to trigger group member response 2023-10-29 19:35:26 +02:00
Cohee
03c3fa24e9 Phone styles adjust 2023-10-29 19:30:56 +02:00
Cohee
483ae22bc3 Add ability to abort generation by extension interceptors 2023-10-29 18:29:10 +02:00
Cohee
9396ca585c #1287 Add user.css file 2023-10-28 12:48:42 +03:00
Cohee
922007ea25 #1294 Fix selective logic for embedded lorebooks 2023-10-28 12:28:03 +03:00
Cohee
97b9d99503 Merge branch 'staging' into release 2023-10-28 03:31:18 +03:00
Cohee
e0be4dde31 Move extensions update check to after init 2023-10-27 21:23:58 +03:00
Cohee
4524f6dbfd Skill issue 2023-10-27 21:09:53 +03:00
Cohee
52ecad1cdf Rework single-line mode, add section for Context Formatting settings 2023-10-27 21:02:03 +03:00
Cohee
9be3645152 Merge pull request #1292 from SillyTavern/staging
Staging
2023-10-27 13:26:43 +03:00
Cohee
a2d8a2a447 Bump package version 2023-10-27 13:23:10 +03:00
Cohee
0ad96b6567 Improve context slider sanity 2023-10-27 13:22:46 +03:00
Cohee
0c36d113bf Add git disclaimer to asset downloader 2023-10-27 13:07:56 +03:00
Cohee
410599b287 Fix unlocked context sliders sanity 2023-10-27 02:01:09 +03:00
Cohee
167b2d0fe4 Add exception handling to stats writer 2023-10-27 01:03:54 +03:00
Cohee
11cc27d9c9 Increase debounce duration for type-in controls to 2sec 2023-10-26 22:02:56 +03:00
Cohee
24f406917d Add seed to Kobold APi 2023-10-26 21:22:00 +03:00
RossAscends
5f64d4be7d fix WI sliders 2023-10-27 03:06:02 +09:00
RossAscends
b29f63f89e fix WI sliders 2023-10-27 03:01:25 +09:00
Cohee
b4c7bb1f7b Merge pull request #1290 from SillyTavern/staging
Staging
2023-10-26 18:44:18 +03:00
Cohee
edbde2be37 Make comment macro multiline 2023-10-26 18:41:35 +03:00
Cohee
1798959ddc Update readme-zh_cn.md 2023-10-26 18:25:51 +03:00
Cohee
d249000b52 Update readme.md 2023-10-26 18:25:10 +03:00
Cohee
58ada40586 Merge pull request #1289 from deffcolony/release
Added new banner for readme.md
2023-10-26 18:18:08 +03:00
deffcolony
f1a13f3093 updated banner 2023-10-26 16:45:03 +02:00
deffcolony
aa3574f15f Added new banner 2023-10-26 15:05:27 +02:00
Cohee
03e513a3e4 Fix slider formatting 2023-10-26 15:17:16 +03:00
Cohee
beca613745 Revert Top P granularity 2023-10-26 15:11:38 +03:00
Cohee
dcca49e848 Revert TFS granularity 2023-10-26 15:09:34 +03:00
Cohee
22cebe3176 Fix settings loading 2023-10-26 15:01:31 +03:00
RossAscends
dd2d292a56 clean up NAI slider decimals 2023-10-26 20:46:09 +09:00
RossAscends
c79bf951b7 minor skill issue with slider overhaul 2023-10-26 20:41:12 +09:00
RossAscends
e9107870c0 Merge branch 'staging' of https://github.com/Cohee1207/SillyTavern into staging 2023-10-26 13:20:49 +09:00
RossAscends
d50124e937 appwide slider overhaul 2023-10-26 13:20:47 +09:00
LammyShark
234baf6276 Toggle Regex Script Checkboxes
Added a checkbox to each Regex Script listed under Saved Scripts to easily enable/disable. It can be cumbersome having to load Regex Editor for each script when disabling/enabling multiple Regex Scripts.
2023-10-25 22:48:19 -04:00
Cohee
339dcaf506 Fix message trigger on disabled character in amalgamate group mode 2023-10-26 02:10:14 +03:00
Cohee
5cdc3d1d18 Smudge groups depth prompts in Join mode. 2023-10-26 00:39:11 +03:00
Cohee
8dcfe57888 #1268 Add group card amalgamation mode 2023-10-26 00:09:22 +03:00
Cohee
2e35cd76ec Merge branch 'staging' of https://github.com/SillyTavern/SillyTavern into staging 2023-10-25 22:39:34 +03:00
Cohee
51d2c9feba Add UI option for group gen strategy 2023-10-25 22:39:31 +03:00
Cohee
864ac3927f Merge pull request #1285 from bdashore3/staging
Add freq pen and presence pen for ooba
2023-10-25 22:38:52 +03:00
Cohee
cb9e334a75 Fix localization strings 2023-10-25 22:36:14 +03:00
kingbri
4f67e9f38b Ooba: Add frequency and presence penalty sliders
These options essentially supersede repetition penalty, but since
ooba also gives the option, add these new sliders in conjunction
with the repetition penalty ones.

More testing is needed to find good default values.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-10-25 15:22:47 -04:00
Cohee
b4a401805f Add explainer for SD prompt expansion 2023-10-25 21:49:32 +03:00
Cohee
f2d5196890 Change scenario override setup method 2023-10-25 19:44:46 +03:00
Cohee
c2ba3a773a Delayed tokenizers initialization 2023-10-25 00:32:49 +03:00
Cohee
3edc456fe7 Extend extensions interop API 2023-10-25 00:28:58 +03:00
Cohee
5dbe2ebf29 Add chat file backups 2023-10-24 22:09:55 +03:00
Cohee
6369ca6483 Merge pull request #1281 from Tony-sama/staging
Live2d assets management
2023-10-24 17:01:17 +03:00
Tony Ribeiro
2b40fc7e76 Use proper path function for live2d asset of character folder 2023-10-24 15:44:40 +02:00
Cohee
52537904f7 Add stopping strings to Horde 2023-10-24 16:23:32 +03:00
Cohee
1bf6d6d9f2 Don't trim the end of instruct last prompt line if newline wrap mode is disabled 2023-10-24 16:02:24 +03:00
Tony Ribeiro
43dae79018 add placeholder in live2d asset folder to have the folder created for users. 2023-10-24 14:47:29 +02:00
Tony Ribeiro
141850eda5 Merge branch 'SillyTavern:staging' into staging 2023-10-24 14:23:45 +02:00
Cohee
affdbb561f Update GPU.ipynb 2023-10-24 13:37:50 +03:00
Cohee
8f118f140f Save settings after selecting persona 2023-10-23 23:22:25 +03:00
Cohee
5b68a438f3 Fix immediate switching between persona namesakes 2023-10-23 23:20:49 +03:00
Cohee
3f9cb7d575 Reduce hr margin 2023-10-23 22:25:17 +03:00
Cohee
85d1a008dd Fix Extras input placeholders 2023-10-23 16:57:40 +03:00
Cohee
f0b20b67de Rearrange ext.panel. Add ext.update notifications. Improve performance on large number of extensions 2023-10-23 16:53:31 +03:00
Cohee
e082138c18 Do shallow clone to speed-up extension installs 2023-10-23 13:27:04 +03:00
Cohee
9a647b96df Add error logging to SD generate endpoint 2023-10-23 13:03:01 +03:00
Cohee
3995238d77 Adjust Anlas guard for NAI Opus 2023-10-23 10:41:39 +03:00
RossAscends
bd9c4d28ca change non-CC API context slider steps to 512 2023-10-23 13:07:04 +09:00
RossAscends
6f79f75f71 remove extra quote mark form bulkdelete html tag 2023-10-23 10:56:46 +09:00
RossAscends
731ebc2eda add toggle for mobile gestures 2023-10-23 10:54:17 +09:00
Cohee
635df947c5 Increase classify sampling window; 300=>500 chars 2023-10-23 02:14:29 +03:00
Cohee
63b34d9851 Call expression module worker when switching chats 2023-10-23 01:56:27 +03:00
Cohee
f9ae7ea949 Add NAI Diffusion v2 model 2023-10-23 01:06:49 +03:00
Cohee
df85218fa7 Merge branch 'release' into staging 2023-10-23 00:27:15 +03:00
Cohee
a4fe78f8ba Merge pull request #1277 from CoryG89/bug-race-condition-tts-autoload-chat
Fix duplicate TTS voicemap UI when autoload last chat is enabled
2023-10-23 00:25:30 +03:00
Tony Ribeiro
4bc2d7f6ac Add management of live2d model in assets folder. 2023-10-22 19:21:10 +02:00
Cory Gross
5b2fff07b8 Fix race condition duplicates TTS UI if autoload chat enabled 2023-10-22 08:54:25 -07:00
Cohee
0517f1bbbc Fix elevenlabs multi-model 2023-10-22 14:46:54 +03:00
Cohee
f49f9c1f96 Merge branch 'release' into staging 2023-10-22 14:01:33 +03:00
Cohee
f9cb6d783e Merge pull request #1263 from bdashore3/preset-expansion
Preset setting expansion
2023-10-22 14:01:06 +03:00
Cohee
600c9c6251 Merge pull request #1274 from CoryG89/bug-tts-autogen-elevenlabs-multilingual 2023-10-22 12:28:35 +03:00
Cory Gross
348805af74 Fix TTS autogen chkbox set by elevenlabs multilingual setting 2023-10-21 22:33:28 -07:00
kingbri
57b299a9cd Presets: Update adventure
Add some default settings and stopping strings.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-10-21 21:58:35 -04:00
Cohee
a662677f06 Add prompt copy button 2023-10-22 00:51:35 +03:00
Cohee
5fa158a37f Add border to enlarged img 2023-10-22 00:43:21 +03:00
Cohee
c49f898886 Display prompts for enlarged images 2023-10-22 00:39:11 +03:00
Cohee
81921bcd77 Saveable SD prefix/negatives 2023-10-22 00:10:48 +03:00
Cohee
18fa925855 Use named constant 2023-10-21 23:33:17 +03:00
Cohee
04a5d9694e Unify preset button styles 2023-10-21 23:32:53 +03:00
Cohee
6296cb8218 Align display name of Summary plugin 2023-10-21 22:20:21 +03:00
Cohee
a4ab898933 Move CFG scale to built-in functionality 2023-10-21 22:19:49 +03:00
Cohee
ed8f5ddc33 Fix BG drawer title position 2023-10-21 21:10:08 +03:00
Cohee
65402eaa23 Move bulk edit to built-in functionality 2023-10-21 21:02:06 +03:00
Cohee
7e116f8b1f Move setting search to built-in functionality 2023-10-21 20:55:51 +03:00
Cohee
999c1b1105 Hide chat BG titles 2023-10-21 20:41:19 +03:00
Cohee
0b535e98b8 Merge branch 'staging' of https://github.com/SillyTavern/SillyTavern into staging 2023-10-21 20:32:39 +03:00
Cohee
4ecf2b9f2d Fix stats init error 2023-10-21 20:32:36 +03:00
Cohee
5012237eb3 Display generated bg in the bg block. Add ability to copy chat bg to system list. 2023-10-21 17:43:25 +03:00
Cohee
8d121bf38f QR menu restyle 2023-10-21 16:17:17 +03:00
Cohee
d0650e6910 Clean-up QR code 2023-10-21 16:09:25 +03:00
IkariDevGIT
1e251c09e3 Better input inject Quick Reply (#1255)
* Force open Char WI with Shift

QoL - Force open character WI selector menu if icon clicked with Shift.

* Update world-info.js (revert personal new WI pos preference)

* Fix element widths

* Fix event typing

* Update index.js

* Update index.js

* change Prompt to Input

this makes it more clear what it does(i think)

---------

Co-authored-by: valden80 <111227649+valden80@users.noreply.github.com>
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2023-10-21 16:02:29 +03:00
Cohee
08a1eaad62 Less obnoxious alt.greetings button 2023-10-21 15:54:05 +03:00
Cohee
b4e29bf157 #1272 Optimize performance of context buttons visibility switch 2023-10-21 15:41:27 +03:00
Cohee
97d75aef73 #1272 Fix control buttons when expand actions is used 2023-10-21 15:17:18 +03:00
Cohee
25c461bd3f Add text to open alternate greetings 2023-10-21 15:10:48 +03:00
Cohee
ca73a3a7b7 Merge branch 'release' into staging 2023-10-21 15:06:19 +03:00
Cohee
3816d7b202 Merge pull request #1271 from Xrystallized/faster-load
Faster past chats load
2023-10-21 15:05:53 +03:00
Cohee
008fcece04 Rewrite to sync readdir, add try-catch, filter out invalid files 2023-10-21 15:04:36 +03:00
Cohee
70fa93f0c9 Clarify note macro docs 2023-10-21 14:42:53 +03:00
Cohee
703965aec8 Substitute macro in character editor token counter 2023-10-21 14:39:01 +03:00
IkariDevGIT
6fe4232f75 Add {{// (note)}} macro (#1265)
* add {{# (note)}} macro

* change from # to // for future updates

* fix docs
2023-10-21 14:28:02 +03:00
Cohee
51e0c9130a Merge pull request #1269 from city-unit/feature/slash
Add token counting slash command.
2023-10-21 14:26:45 +03:00
Cohee
85de505553 Move counter to plugin. Use chat context to get messages 2023-10-21 14:23:56 +03:00
Xrystal
1d38109dcf Use JSON instead of json5 2023-10-21 18:56:51 +08:00
Xrystal
6f0f420063 Promisify getallchatsofcharacter 2023-10-21 18:55:52 +08:00
city-unit
63ecca1fe2 Add token counting slash command. 2023-10-21 01:04:16 -04:00
RossAscends
b41bf7cf4e Merge pull request #1267 from city-unit/feature/ui
Minor Fix: Hide extra buttons when you click away
2023-10-21 11:36:40 +09:00
city-unit
95a3021e53 Smooth transition 2023-10-20 22:31:57 -04:00
city-unit
b8939b8ccb Hide extra buttons when you click away 2023-10-20 22:14:36 -04:00
kingbri
8d6eaf3da4 Power User: Fix preset error
The checkbox wasn't being looked up correctly, causing issues when
setting some properties.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-10-20 22:05:03 -04:00
kingbri
18c74ecf09 Power User: Reduce preset settings
Make presets affect less settings that are commonly manually changed
by people after setting one.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-10-20 21:18:48 -04:00
Cohee
f285110773 Merge chat backgrounds plugin with main backgrounds menu 2023-10-21 01:40:58 +03:00
Cohee
7f8df9533b Auto-complete code blocks during streaming 2023-10-20 23:52:23 +03:00
Cohee
e4cb916dff Example messages behavior to 3-state selector 2023-10-20 20:09:31 +03:00
Cohee
0b0b125bca Don't double-expand prompts if reusing 2023-10-20 15:43:55 +03:00
Cohee
c4e6b565a5 Add SD prompt expansion 2023-10-20 15:03:26 +03:00
kingbri
6e4236d5ee Presets: Add power user setting support
Settings such as adding character name, stopping strings, etc can be
preset specific. This change is mainly inspired because people (like myself)
often forget to change these settings after switching a preset, which
can cause weird responses from the model.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-10-20 02:07:45 -04:00
Cohee
5c6343e85e #1259 Add more weight to char.name in fuzzy search 2023-10-19 14:03:38 +03:00
Cohee
50924a0672 Merge branch 'staging' of https://github.com/SillyTavern/SillyTavern into staging 2023-10-19 13:37:38 +03:00
Cohee
b167eb9e22 Add raw token ids support to OAI logit bias. Fix token counting for turbo models 2023-10-19 13:37:08 +03:00
Tony Ribeiro
fae364f079 Merge branch 'staging' of https://github.com/Tony-sama/SillyTavern into staging 2023-10-19 00:36:24 +02:00
Tony Ribeiro
2149bee87f Add handling of multiple live2d asset per character 2023-10-19 00:36:19 +02:00
Tony Ribeiro
08bee074ac Merge branch 'SillyTavern:staging' into staging 2023-10-19 00:35:12 +02:00
Cohee
ec8d30a19d Remember confirm for assets list 2023-10-19 00:26:00 +03:00
Cohee
31242e23eb Merge pull request #1249 from bdashore3/staging
Add ask command
2023-10-18 21:28:20 +03:00
Cohee
9611e31481 Respect trusted worker flag if auto-adjust is enabled 2023-10-18 14:25:05 +03:00
Cohee
5d1fff3df6 Don't add a newline at the end of empty story string 2023-10-18 11:44:45 +03:00
Tony Ribeiro
1dd747a24d Merge branch 'SillyTavern:staging' into staging 2023-10-17 20:18:29 +02:00
Cohee
cc3e27eca1 Merge pull request #1253 from valden80/shift-open-char_wi
Force open char WI selector with Shift-click
2023-10-17 13:56:39 +03:00
Cohee
77f0fe5b80 Fix event typing 2023-10-17 13:55:02 +03:00
Cohee
5c316b50fa Merge branch 'staging' of https://github.com/SillyTavern/SillyTavern into staging 2023-10-17 13:09:53 +03:00
Cohee
e8dd2e2b4d Fix element widths 2023-10-17 13:09:46 +03:00
valden80
81f1bfd23f Update world-info.js (revert personal new WI pos preference) 2023-10-17 03:15:18 +03:00
valden80
819b92a1d5 Force open Char WI with Shift
QoL - Force open character WI selector menu if icon clicked with Shift.
2023-10-17 03:10:57 +03:00
Cohee
eaadb1c5c2 Prevent double insert of chat lore 2023-10-16 23:13:32 +03:00
Cohee
6a1b230c7e #1226 Add chat-bound lorebooks 2023-10-16 23:03:42 +03:00
Cohee
8a3547ecd0 #1248 Fix a server crash on unexpected models response 2023-10-16 20:25:51 +03:00
Cohee
4f458ce93a Fix import of presets with spaces 2023-10-16 20:01:45 +03:00
Cohee
59af85ce1c #1250 Fix multiple card import tags 2023-10-16 11:37:04 +03:00
kingbri
dfa25a1796 Commands: Add ask command
The ask command aims to ask another character about a question or
topic from the current chat. Essentially, the current chat is taken
out and prompted to another character.

This command also requires a few fixes to sprites and prompt creation.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-10-16 02:12:12 -04:00
Cohee
2a16d24760 Increase 0301 padding 2023-10-16 02:21:27 +03:00
Cohee
4657aef306 Improve inline preview of audio assets 2023-10-16 02:09:43 +03:00
Cohee
9ee2c2e9c1 Add asset preview links 2023-10-16 01:39:08 +03:00
Cohee
02dca52948 Add extra padding for 0301 turbo model. 2023-10-16 01:21:14 +03:00
Cohee
5b954a3584 Rename URL validation util function 2023-10-16 00:50:29 +03:00
Cohee
0f15d2d45b Move Idle extension to external repo. 2023-10-16 00:02:37 +03:00
Cohee
6a9f4a57b9 Move dynamic audio to external repository 2023-10-15 23:03:53 +03:00
Cohee
c8dace09b7 Add failsafe condition preventing gens when cfg settings are not found 2023-10-15 22:21:19 +03:00
Cohee
92ddb2b791 Move HypeBot to external repo 2023-10-15 20:03:52 +03:00
Cohee
30c76eb420 Move dice extension to external repository 2023-10-15 19:56:07 +03:00
Cohee
579f43ed1c Move objective extension to external repo 2023-10-15 19:48:12 +03:00
Cohee
6e6e5f4747 Group popout "improvements" 2023-10-15 19:42:23 +03:00
Cohee
421cda2ef0 Move RVC plugin to external repository 2023-10-15 17:27:11 +03:00
Cohee
0a742b867f Move chromadb plugin to external repository 2023-10-15 16:57:37 +03:00
Cohee
82032133f1 Move randomizer plugin files to external repository 2023-10-15 16:23:32 +03:00
Cohee
b4c3985b61 Disable cache of assets loader 2023-10-15 16:16:35 +03:00
Cohee
19363f6cb9 Move variables extension to external repo 2023-10-15 16:08:19 +03:00
Cohee
d1d14bca13 Merge pull request #1245 from majick/tag-field-wtf-logspam
Make v2 spec read logspam at least slightly actionable.  Slightly.
2023-10-15 15:34:14 +03:00
majick
89d7a05ea7 Missed a spot 2023-10-14 20:08:45 -10:00
majick
a9ebd2f80e Make v2 spec read logspam slightly actionable
The existing logspam doesn't even tell the user what char is failing, which means it's
just going to emit every startup, forever, grinding at the poor user's soul, never
letting them know *which* of their 352 cards is causing the spam... day after day after
day.  Until one day, the poor beleaguered user will emit the world's ugliest PR to at
least find the broken card in an attempt kill it.

Ask me how I know.
2023-10-14 17:41:23 -10:00
Cohee
d0637750e7 Add system message collapse for chat comps 2023-10-14 22:05:09 +03:00
Tony Ribeiro
29f045636a Merge branch 'SillyTavern:staging' into staging 2023-10-14 04:35:42 +02:00
Tony Ribeiro
2f3ded734f Added live2d asset category to allowed character assets. 2023-10-14 04:35:09 +02:00
Cohee
658701a943 Merge branches 'staging' and 'staging' of https://github.com/SillyTavern/SillyTavern into staging 2023-10-13 21:58:33 +03:00
Cohee
61f164b5ff Remove ChromaDB from readmes 2023-10-13 21:58:28 +03:00
RossAscends
7f50d84953 put headers on a diet 2023-10-14 01:09:53 +09:00
RossAscends
19ff0fd618 clean up draggables, gallery, and close buttons 2023-10-14 00:29:41 +09:00
Cohee
d82eb373a6 Less obnoxious hr style 2023-10-13 13:11:21 +03:00
Cohee
edb46f480f Merge branch 'staging' of https://github.com/SillyTavern/SillyTavern into staging 2023-10-13 11:42:45 +03:00
Cohee
a1f6220f33 Nicer display of 3rd-party extension assets 2023-10-13 11:42:38 +03:00
Cohee
410f08a317 Merge pull request #1240 from Tony-sama/staging
Removed speech recognition extension (now third party)
2023-10-13 11:42:07 +03:00
Cohee
e9a12b2f4e Merge pull request #1236 from 50h100a/webui_streaming_errmsg
Check for errors on the `stream_end` event
2023-10-13 11:35:56 +03:00
Tony Ribeiro
2997522c52 Removed speech recognition extension (now third party extension download from assets menu). 2023-10-13 01:34:00 +02:00
RossAscends
a87580663e HR divorces theme border color 2023-10-12 21:13:57 +09:00
Cohee
b5d93f477a Merge pull request #1239 from bdashore3/staging
Include AN into WI scanning
2023-10-12 14:19:37 +03:00
kingbri
2c1a6ca67c World Info: Add scanning with AN
Add support for adding extension prompts into WI scanning. Doing this
required adding a method to get extension prompts by name. Now, AN
and depth prompts can be added to world info scanning.

However, since scanning just looks for keys in the chatlog, append
the extension prompts on the top of scanned text.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-10-11 23:50:58 -04:00
Cohee
84098ae933 Fix injection order (again) 2023-10-11 22:56:17 +03:00
Cohee
e2f0162e5a Fix injection order 2023-10-11 22:42:25 +03:00
Cohee
59ae661f62 Fix itemization viewer 2023-10-11 22:09:24 +03:00
Cohee
c4fbc8373d Add raw generate function 2023-10-11 17:56:52 +03:00
Cohee
abb78d1d6b Add at-depth position for custom Prompt Manager prompts 2023-10-11 16:03:36 +03:00
RossAscends
6b5aa9d06e toggle to skip WI&AN insertion in Summary's prompt 2023-10-11 19:44:22 +09:00
50h100a
6e78ec11fb Check for errors on the stream_end event 2023-10-10 18:04:28 -04:00
Cohee
7be3718a36 Fix first.mes continue for Chat Comps 2023-10-10 20:54:09 +03:00
Cohee
2c54627926 Format code 2023-10-10 20:48:21 +03:00
Cohee
9d710801d8 Merge branch 'staging' of https://github.com/SillyTavern/SillyTavern into staging 2023-10-10 20:48:10 +03:00
Cohee
3fceee8f2b Merge pull request #1230 from ThisIsPIRI/worldimport
Add option to use the old embedded WI toast
2023-10-10 20:45:36 +03:00
ThisIsPIRI
3eb8f56b00 Add option to use the old embedded WI toast 2023-10-11 00:08:08 +09:00
kingbri
dbf964e430 Script: Fix greeting message with continue
Add author's note when continuing the first message of a conversation.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-10-10 14:26:41 +03:00
Cohee
3f406dcdf0 Merge pull request #1228 from Tony-sama/staging 2023-10-10 09:41:02 +03:00
Tony Ribeiro
12a37e5342 correct placeholder text. 2023-10-10 01:52:09 +02:00
Tony Ribeiro
47d4561bf8 Merge branch 'SillyTavern:staging' into staging 2023-10-10 01:51:30 +02:00
Tony Ribeiro
93d1a264da Add official blip asset management. 2023-10-10 01:51:09 +02:00
RossAscends
f88f360404 add padding back to summary popout 2023-10-10 05:53:55 +09:00
RossAscends
83f689d9eb Merge branch 'staging' of https://github.com/Cohee1207/SillyTavern into staging 2023-10-10 05:52:08 +09:00
RossAscends
b1769153c7 add background coloring to popped out Summary 2023-10-10 05:52:06 +09:00
Cohee
1239026a8f Auto-update extensions on version change 2023-10-09 23:45:09 +03:00
RossAscends
575e21a1f5 Merge branch 'staging' of https://github.com/Cohee1207/SillyTavern into staging 2023-10-10 04:49:37 +09:00
RossAscends
96ddd5f4e5 draggable popout for Summary 2023-10-10 04:49:35 +09:00
Cohee
15c81749b8 Filter out invalid/broken characters 2023-10-09 19:17:49 +03:00
Cohee
0873d3eaf9 Filter out invalid/broken characters 2023-10-09 19:09:33 +03:00
Cohee
d81151efa2 Fix first message duplication 2023-10-09 18:22:50 +03:00
Cohee
b84e6e07d1 Assets extensions visual touch-up 2023-10-09 17:21:12 +03:00
Cohee
c9f9bcfc86 Merge pull request #1224 from Tony-sama/staging
Minor safety changes to handle blip extension
2023-10-09 12:08:42 +03:00
Tony Ribeiro
6c1ba0aa13 Merge branch 'SillyTavern:staging' into staging 2023-10-09 01:44:16 +02:00
Tony Ribeiro
df4ca46c02 Save chat id between received and rendered event for safety (blip extension allow multiple message received before one is rendered). Added export in translate extension for usage in blip extension. 2023-10-09 01:26:57 +02:00
RossAscends
dac9c091b2 Merge branch 'staging' of https://github.com/Cohee1207/SillyTavern into staging 2023-10-09 08:22:02 +09:00
RossAscends
e29902ed66 '/help slash' hint for how to batch slash commands 2023-10-09 08:22:00 +09:00
Cohee
b3cdfe4fdf Adjust min value of NAI rep.pen.slope 2023-10-08 23:57:49 +03:00
Cohee
d265179f46 Don't crash ST server on invalid streaming URL 2023-10-08 23:42:28 +03:00
Cohee
54d52a2986 Manage extensions via the assets plugin 2023-10-08 23:20:01 +03:00
Cohee
4f80085fa3 Add sanitation of Stable Horde prompts 2023-10-08 22:29:33 +03:00
Cohee
c9c4f30637 Merge pull request #1223 from SillyTavern/staging
Staging
2023-10-08 21:08:26 +03:00
RossAscends
1c095415a4 fix WI panel display on autoimport char lorebooks. 2023-10-08 23:04:53 +09:00
RossAscends
19acc05516 subsort WI Depth sort by Order to match prompt loc 2023-10-08 20:12:14 +09:00
Cohee
2cbde8b55c #1221 Button to refresh WI sorts 2023-10-08 12:30:12 +03:00
Cohee
15cf87ef01 Fix new group avatar upload 2023-10-08 11:34:39 +03:00
Cohee
57bf499ce9 Fix group expressions 2023-10-08 11:22:48 +03:00
Cohee
4fbbd34db9 Add presets for Story and Adventure 2023-10-07 23:18:00 +03:00
Cohee
9b04e43b4c Remove examples separator from ChatML 2023-10-07 22:36:53 +03:00
SDS
5848ec498b Assorted fixes and improvements (#1208)
* Kobold Presets fixed

* Help texts fixed

* Scale API for connectAPISlash

* Quick Reply checkboxes fixed

* New Instruct Mode Presets

* More date/time macros

* ChatML context template and instruct prompt format

* Mistral context template and instruct prompt format

* Removed use_default_badwordsids from kobold presets

* Renamed ChatML to Mistral-OpenOrca (ChatML)

* Renamed Mistral-OpenOrca (removed ChatML)

* Removed single_line from kobold presets

* Removed obsolete use_stop_sequence setting

* Ban EOS Token off by default

* Split AI Resp. Conf. in global and preset-specific settings

* Resolve conflicts

* Fix title

* Add translations for new help texts

* Fix i18n.json whitespace

* Make Mistral-OpenOrca system prompt more generic

* Renamed "Mistral-OpenOrca" to "ChatML" again

* More (UI) fixes and improvements

* Sendas hint fixed

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2023-10-07 19:25:36 +03:00
Cohee
5a570ff283 Merge branch 'staging' of https://github.com/SillyTavern/SillyTavern into staging 2023-10-07 18:30:19 +03:00
Cohee
1dd6fa4b6a Add Sd.next source 2023-10-07 18:30:06 +03:00
Cohee
32377fd131 Unhide constant WI probability 2023-10-06 18:47:03 +03:00
Cohee
2f294b9f2b [chore] Reformat code 2023-10-06 15:55:11 +03:00
yuxiang
0b8295926e add bing translate 2023-10-06 15:51:04 +03:00
yuxiang
76507963d7 add bing translate 2023-10-06 19:39:03 +08:00
Cohee
27ce0b5eb7 Stabilize WI sorting order 2023-10-06 01:18:50 +03:00
RossAscends
2797b4bd89 Merge branch 'staging' of https://github.com/Cohee1207/SillyTavern into staging 2023-10-06 06:27:54 +09:00
RossAscends
e9ba20f13c WI Entry transitions: all >>> opacity 2023-10-06 06:27:49 +09:00
Cohee
1ef68a34fe Fix bamboozling UI hint 2023-10-06 00:13:16 +03:00
RossAscends
4189da19b1 Merge branch 'staging' of https://github.com/Cohee1207/SillyTavern into staging 2023-10-06 05:56:47 +09:00
RossAscends
ad3f8e7bf4 Merge branch 'staging' of https://github.com/Cohee1207/SillyTavern into staging 2023-10-06 05:56:45 +09:00
Cohee
0dfe46a162 Add WI title backfill button 2023-10-05 23:56:31 +03:00
RossAscends
edeb804128 fix WI Entry control titles for mobile 2023-10-06 05:55:39 +09:00
Cohee
b49f234185 Merge branch 'staging' of https://github.com/SillyTavern/SillyTavern into staging 2023-10-05 23:30:23 +03:00
Cohee
85a63b3bb3 Add WI entry sorting. Add new entry flash 2023-10-05 23:30:18 +03:00
RossAscends
04a0d012fc WI: quick cope for mobile entry display 2023-10-06 05:27:36 +09:00
RossAscends
eaa33f2544 WI Entry titles on left, controls on right. 2023-10-06 03:40:39 +09:00
RossAscends
d5004d79bd remove double WI Entry header padding 2023-10-06 03:34:34 +09:00
Cohee
96be2ebf35 Merge branch 'staging' of https://github.com/SillyTavern/SillyTavern into staging 2023-10-05 21:13:23 +03:00
Cohee
fc90843207 Add WI sort dropdown 2023-10-05 21:13:18 +03:00
RossAscends
679d40b3ce Merge branch 'staging' of https://github.com/Cohee1207/SillyTavern into staging 2023-10-06 03:02:45 +09:00
RossAscends
5307ee5d17 WI: Prob%, Memo to header, Keywords to main 2023-10-06 03:02:43 +09:00
Cohee
dd753498fa Unscrew zoomed mobile avatars width 2023-10-05 18:01:11 +03:00
RossAscends
30e5a31591 Position, Depth, Order Inputs to WI Entry header 2023-10-05 23:40:48 +09:00
RossAscends
2befd69c31 Merge branch 'staging' of https://github.com/Cohee1207/SillyTavern into staging 2023-10-05 20:10:19 +09:00
RossAscends
995b4d07ff WI: 🔵>🟢 & 🟡>🟢 2023-10-05 20:10:16 +09:00
valden80
788bbe969f Feature, ability to add banned words sequences from anywhere through {{banned "..."}} macro. (#1202)
* Add files via upload

* Add files via upload

* Add files via upload

* Add files via upload

* Add files via upload

* Fix constant assignment, reformat code

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2023-10-05 13:10:41 +03:00
Cohee
99a89a7329 Less discrete embedded lorebook prompt 2023-10-04 22:41:10 +03:00
Cohee
f8b5fe8b1e Add Character note to char.card embeds 2023-10-04 22:13:56 +03:00
majick
368cba1149 Add Lightning 1.1 Context and Instruct templates (#1214)
* Add Lightning 1.1 Context and Instruct templates

* Remove double white space

* Fix fancy apostrophe

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2023-10-03 20:05:15 +03:00
RossAscends
dac6639cc1 Merge branch 'staging' of https://github.com/Cohee1207/SillyTavern into staging 2023-10-02 09:29:18 +09:00
RossAscends
345a0e04fc Add '/nar' as alias for /sys 2023-10-02 09:28:25 +09:00
Cohee
82182015e2 Allow group nudge in chat completions. 2023-10-02 00:24:16 +03:00
RossAscends
384e8d43a6 further improve WI entry state display 2023-10-02 02:43:23 +09:00
Cohee
b203b22d4d Remove commented-out code 2023-10-01 19:36:53 +03:00
AlexVeeBee
b9ea0061d5 Fix Dynamic Audio player looks
- Removed unnecessary text for audio player
- Fixed styling for audio player
2023-10-01 15:49:53 +00:00
Cohee
e9afb39a4a Merge branch 'release' into staging 2023-10-01 16:37:18 +03:00
Xrystal
df55a66153 Add preset settings to Docker public (#1204) 2023-10-01 16:36:52 +03:00
valden80
6df0c2acf3 Better wi 2 (#1203)
* Update world-info.css

* Update index.html

* V-center Wi delete

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2023-10-01 15:46:06 +03:00
Cohee
046bf20592 Update default objective prompts 2023-10-01 15:39:31 +03:00
RossAscends
2879e2701f Merge branch 'staging' of https://github.com/Cohee1207/SillyTavern into staging 2023-10-01 10:23:39 +09:00
RossAscends
7771ecb0d0 WI disable/constant checkboxes to tristate select 2023-10-01 10:21:19 +09:00
valden80
cc9f452699 Better wi cards (#1200) 2023-09-30 23:19:49 +03:00
yukikun-dev
a8fb2d9bee Fix GPT4-32k model (#1198) 2023-09-30 23:18:31 +03:00
Cohee
165997c791 #1199 I'm not even sure anymore 2023-09-30 15:42:37 +03:00
Cohee
22e3c25e12 Doc string for bias 2023-09-29 15:06:19 +03:00
AlpinDale
495b7eebbf chore: fix href for aphrodite (#1196)
The current href leads to text-generation-webui, this PR changes that to the correct URL.
2023-09-28 22:44:19 +03:00
Cohee
4c39a32be1 Don't reset instruct preset when toggling instruct mode 2023-09-28 21:59:03 +03:00
Cohee
584d7961eb Close message editor before regenerating. #1195 2023-09-28 21:47:55 +03:00
Cohee
977421edb7 Add comment 2023-09-28 21:33:03 +03:00
Cohee
f0b48aabff #1194 Fix chat width misbehaving in Firefox 2023-09-28 21:30:41 +03:00
Cohee
191c180946 Fix streaming url validation 2023-09-28 20:47:33 +03:00
Cohee
03fe8f88f9 Merge branch 'staging' of https://github.com/SillyTavern/SillyTavern into staging 2023-09-28 19:10:04 +03:00
Cohee
bb47712696 Split oobabooga/mancer sources. Add aphrodite support 2023-09-28 19:10:00 +03:00
RossAscends
f466ff3243 update WI Pos/Depth/Order hint on value change 2023-09-29 00:27:12 +09:00
Cohee
306cf51da4 #1180 Add custom token bans. Return grammar strings 2023-09-27 22:09:09 +03:00
Cohee
5857823c3b Revert "More Mexican Spanish Translation (#1184)" (#1190)
This reverts commit 02418d2d97.
2023-09-27 09:53:56 +03:00
Call me Jim
02418d2d97 More Mexican Spanish Translation (#1184)
* More spanish translation, fixed typo on index

Praying that typo fix won't mess with the other translations. Changed "idel" for "idle".

* Changed "es-spa" to "es-mx"

For Mexican Spanish. Spanish has a ridiculous amount of variants and the wording that might seem fine to me might be weird or maybe offensive in other variants.

* Trying to translate the View API key pop up

I'm also failing badly

* "Mirostat Mode" was repeated twice. Not anymore.

Also more Mexican Spanish translation.

* Mirostat Tau and Mirostat Era aren't repeated anymore.

* Partially translated AI Response Formatting to es-MX
2023-09-27 09:52:49 +03:00
Cohee
0569b706dc Add Palm model icon 2023-09-26 19:17:50 +03:00
Brian Dashore
bfda5a5492 Extra fixes (#1185) 2023-09-26 09:53:04 +03:00
Cohee
03e5ca054d Limit number of custom stop strings for Palm API 2023-09-25 23:12:14 +03:00
Cohee
3e29d39f05 Fix Palm when streaming is enabled 2023-09-25 20:24:56 +03:00
Cohee
01f14b461f Fix embedded lorebook depths 2023-09-25 20:11:16 +03:00
Cohee
edb79d8c53 Synchronize max depths for plugins 2023-09-25 19:29:24 +03:00
kalomaze
db71b87309 Basic Mirostat option descriptions (#1155)
* Basic miro desc

* Fix formatting

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2023-09-25 15:32:53 +03:00
theunstableman
8f426a0184 [FIXED] Add PaLM vectorization source (#1182)
* Add PaLM vectorization source

* FIX

* Add API key check. Fix comment

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2023-09-25 15:29:28 +03:00
Cohee
773d42b886 Suspend ooba grammar 2023-09-25 14:07:13 +03:00
RossAscends
1b7c51ebde Merge branch 'staging' of https://github.com/Cohee1207/SillyTavern into staging 2023-09-25 18:03:18 +09:00
RossAscends
e2d4f9dc8c streamline WI display 2023-09-25 18:03:10 +09:00
qHiyokop
0a9b595f80 Italian Translation Update #2 (#1177)
Co-authored-by: qHiyokop <caroligattini@gmail.com>
2023-09-25 11:26:46 +03:00
Cohee
86e9974410 Add grammar for ooba llama.cpp 2023-09-24 17:57:00 +03:00
Cohee
423f88a458 Skill issue 2023-09-24 15:04:02 +03:00
Cohee
9bc3e4e47c #1175 Substitute macro params in KCPP grammar 2023-09-24 14:58:35 +03:00
Cohee
1838ca1994 Replace magic numbers with named constants 2023-09-24 14:45:04 +03:00
Brian Dashore
2411006fdb World Info: Add insertion order at depth (#1174)
Depth previously injected entries randomly. This is not ideal for
world info architectures that rely on insertion order to function
properly.

Redo depth injection to have its own parameter and redo how it's
handled in generate.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-09-24 14:41:56 +03:00
Brian Dashore
5421925d6c Add character specific locks for WI and LB (#1170)
* World Info: Add character locking for entries

With the addition of depth, world info has become more important than
ever. However, there is a conflict that can occur when using multiple
world info or lorebooks on a character. Add the ability to lock
entries to a specific character (or characters) if needed.

This allows for adequate separation especially when there are character
cards each with their separate lorebooks that build off of a core lorebook.

Signed-off-by: kingbri <bdashore3@proton.me>

* World Info: Add entry-specific character exclusions

This is the opposite of locking an entry to a specific character.
Exclusions allows the entry to get included for everyone except the
specified characters in the list.

Signed-off-by: kingbri <bdashore3@proton.me>

---------

Signed-off-by: kingbri <bdashore3@proton.me>
2023-09-23 22:35:51 +03:00
Cohee
d9b2b9f753 Bump package version 2023-09-23 20:51:55 +03:00
Cohee
a081f78bd8 (WIP) PaLM API 2023-09-23 20:48:56 +03:00
Cohee
5275e0c904 Full granularity of font scale slider 2023-09-23 12:09:34 +03:00
Cohee
2903167fad Remove unnecessary font-weight definitons in message text styles 2023-09-23 11:51:15 +03:00
RossAscends
a25cb024fe allow blur/shadow sliders to re-enable. 2023-09-23 11:56:24 +09:00
Cohee
6203d82f48 Update docker-publish.yml 2023-09-23 01:12:47 +03:00
Cohee
21ebe0c148 Update docker-publish.yml 2023-09-23 01:09:51 +03:00
Cohee
43510d5626 Update feature-request.yml 2023-09-23 00:38:59 +03:00
Cohee
3cd97b0772 Update bug-report.yml 2023-09-23 00:37:30 +03:00
Cohee
bd72f0eeb0 Update bug-report.yml 2023-09-23 00:37:11 +03:00
Cohee
565327fe1e Merge pull request #1168 from SillyTavern/staging
Staging
2023-09-22 23:07:52 +03:00
Cohee
2e5bbf0445 Fix server crash on local captioning 2023-09-22 23:04:26 +03:00
Cohee
ec6b6ab8d4 Restyle custom CSS input 2023-09-22 21:49:30 +03:00
Randall Fitzgerald
654a34f932 Added custom CSS box to UI Theme settings (#1166)
* Added custom CSS box to UI Theme settings

* Update index.html

Merged against release instead of staging. Whoops.

* Added an import stripper regex so that imports will be removed and show a toastr to inform the user.

* Moved import remove code to applyCustomCSS. Updated localStorage. Not re-running saveSettingsDebounced()
2023-09-22 21:13:58 +03:00
Cohee
3d1312c13a Restyle chat width slider 2023-09-22 16:56:01 +03:00
RossAscends
52cf684444 Merge branch 'staging' of https://github.com/Cohee1207/SillyTavern into staging 2023-09-22 22:27:08 +09:00
RossAscends
54c37e945b fix themes application, refactor user settings 2023-09-22 22:16:24 +09:00
Cohee
ecab8a6cb4 Fix mes.id and mes.tokens theme checkboxes not saving 2023-09-22 12:44:36 +03:00
RossAscends
b1ab1451ec separate chat and menu background color selection 2023-09-22 16:54:51 +09:00
RossAscends
b84fbed800 Merge pull request #1165 from city-unit/patch-2
Update readme.md
2023-09-22 14:16:40 +09:00
RossAscends
ccf66e6343 Merge pull request #1164 from city-unit/staging
Quick and dirty stat re-creator button
2023-09-22 14:16:29 +09:00
city-unit
5e8fc39735 Update readme.md
add city_unit
2023-09-21 19:59:01 -04:00
city-unit
cd1a8c9224 Quick and dirty stat re-creator button 2023-09-21 17:34:09 -04:00
Cohee
ae4a9a7b14 Remove legacy chat lazy load 2023-09-21 22:07:56 +03:00
Cohee
6ae1b7a72b Filter out "undefined" stopping strings 2023-09-21 22:02:51 +03:00
Cohee
d8380a390a Set numeric limits on WI order/depth 2023-09-21 21:26:30 +03:00
Cohee
5fbb232d69 Fix sprites plugin console spam 2023-09-21 21:15:05 +03:00
Cohee
25d818ecbd Reinsert summary extension prompt instantly when changing position 2023-09-21 21:13:24 +03:00
Cohee
5dd9a87dc9 Add position prop to prompt object 2023-09-21 20:57:28 +03:00
Cohee
857ce2c577 Merge branch 'staging' of https://github.com/SillyTavern/SillyTavern into staging 2023-09-21 20:46:11 +03:00
Cohee
902acc44a2 Support "before main prompt" extension position in prompt manager 2023-09-21 20:46:08 +03:00
RossAscends
22a0bf9451 fix extension update endpoint 2023-09-22 02:42:06 +09:00
Cohee
ad95be2500 Merge branch 'staging' of https://github.com/SillyTavern/SillyTavern into staging 2023-09-21 19:30:23 +03:00
Cohee
071b901f87 Add before story position for A/N and summary 2023-09-21 19:30:20 +03:00
kalomaze
ad9382a98c Custom --grammar support [for koboldcpp] (#1161)
* Basic kobold grammar implementation

This is probably jank as all hell, I don't write js, but I think I got it to work.

* No value by default

* Visual cleanup

+ reworded it a bit

* Conditionally enable Grammar based on version flag. Fix layout

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2023-09-21 15:21:59 +03:00
RossAscends
49c26f3810 keep input focus while adding tags 2023-09-21 17:17:15 +09:00
RossAscends
86c7a7a058 @Depth insertion for WI Entries 2023-09-21 16:04:34 +09:00
RossAscends
0178c95f6f Merge pull request #1162 from city-unit/feature/branch
Add branching as distinct from bookmarking
2023-09-21 13:57:25 +09:00
city-unit
440ecfc991 Fix toasts 2023-09-21 00:40:38 -04:00
city-unit
e0b5df97c4 Add branching as distinct from bookmarking 2023-09-20 22:48:05 -04:00
Cohee
e3f760a9dd Add assistant postfix to converted ChatML => text completion prompts. 2023-09-20 21:50:14 +03:00
Tony Ribeiro
c9783640c0 Dynamic Audio UI: more controls (#1127)
* Added control to audio ui to select bgm/ambient and lock selection to overide dynamic audio update. Load both assets and char specific audio assets

* correct ambient label and default value when no assets available.

* add padding in audio select

* Correct audio change of background ambient when locked. Updated CSS of audio ui for mobile friendly.

* add space between mixer

* Add checkbox to enable dynamic bgm/ambient switch

* correct background ambient fadout

* continue debuging ambient audio update

* finish debuging

* Fix BGM console error on first run. Reformat plugin code

* Changed audio bgm lock into loop on/off. Added random pick button for bgm. Moved ambient lock button to right.

* Add mouse wheel event handler on volume controls

* Change bgm select to only contain current chat character bgm (solo/group). When enable expression bgm is off, any of the char+asset bgm can play next if not looping.

* Corrected bgm looping at start. Force random to play another song if there is any.

* Format code

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2023-09-20 21:36:50 +03:00
RossAscends
f4d1e2a46e Merge pull request #1158 from bdashore3/staging
Add before story string/prompt option
2023-09-20 14:27:27 +09:00
kingbri
b52f71dcce Vectors: Add before story string/prompt option
This makes the most sense for placement of memories. Add the functionality
for other extension prompt placements as well.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-09-20 00:06:43 -04:00
Maks
158aa79aed add model gpt-3.5-turbo-instruct and 0914 variant (#1154) 2023-09-19 23:50:27 +03:00
Daleth Darko
3fe2b21686 Update docker-compose.yml to keep images (#1153) 2023-09-19 21:36:47 +03:00
Cohee
dfbeb41afa #1152 Filter repeating message hashes when inserting vectors 2023-09-19 17:12:22 +03:00
Cohee
3d4054f10e Merge branch 'release' of https://github.com/SillyTavern/SillyTavern into release 2023-09-19 14:08:57 +03:00
Cohee
6c6f914655 Update colab 2023-09-19 14:08:53 +03:00
Cohee
3de5cdd7e8 Apply UI bg color to dialogue popup 2023-09-19 12:21:32 +03:00
RossAscends
eb6e987f55 search bar for user settings panel 2023-09-19 14:19:22 +09:00
Cohee
10f27f41d1 Better Horde error reporting 2023-09-18 18:00:11 +03:00
Cohee
3d83d1d5b7 Add a note that idle timer is in seconds 2023-09-18 17:49:23 +03:00
RossAscends
cfd6a26881 Merge pull request #1150 from city-unit/patch-1
Add idle slash command toggle
2023-09-18 13:59:01 +09:00
city-unit
e92d4a3dbf Add idle slash command toggle 2023-09-18 00:53:23 -04:00
RossAscends
1189734c62 Merge pull request #1148 from city-unit/patch/collab
Fix collab to generate an api key
2023-09-18 13:23:48 +09:00
city-unit
a78bb82b44 Fix collab to generate an api key 2023-09-17 23:53:11 -04:00
Cohee
3a8383ab79 Append continue message timer instead of rewriting 2023-09-18 02:12:06 +03:00
Cohee
dc1c477d62 Uncomment page size selector in WI editor 2023-09-18 01:52:41 +03:00
Cohee
e9c459690f Don't classify when no sprites/default. H-center sprite in non-waifu mode 2023-09-18 01:49:00 +03:00
Cohee
43de36b331 Properly center send buttons 2023-09-18 01:24:29 +03:00
Cohee
39567cf278 Slash command to summarize chat 2023-09-18 01:02:02 +03:00
city-unit
0033090a93 Idle Response / Continuous Generation (#1132)
* Initial idle stuff

* Much closer, can now quietly send as user to get a char response.

* Tweaks

* Better, reset the count of getting a message back, don't send while prompt is waiting.

* Allow selecting who is being prompted

* Comments and cleaup

* Remove char name for the moment (needs something here probably)

* Add random time period and "Always add character's name to prompt" respect

* Tooltips

* Load/unload listeners

* Reduce log spam

* Add inline prompt inclusion

* Add full loud prompting

* Comments

* Fix instruct newline (I think)

* Don't reset count on continue

* add quietToLoud for script.js

* add quietToLoud for slashcommands.js

* Keep instruct directives

* Removed some logging, don't do the Novel formatting if Q2L

* Logspam begone.

* Removed a bit more logging

* Add alignment style

* Reformat files. Add comments

* Reorder extensions

* Fix repeat logic to prompt once then only repeat the number specified

* Make repeat count more clear

---------

Co-authored-by: RossAscends <124905043+RossAscends@users.noreply.github.com>
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2023-09-17 22:00:10 +03:00
RossAscends
ef8c347a95 Merge branch 'staging' of https://github.com/Cohee1207/SillyTavern into staging 2023-09-17 23:00:25 +09:00
RossAscends
535ec8c42d horde model selection QoL 2023-09-17 23:00:23 +09:00
majick
66911160c0 The popular mirostat "Gold/Silver/Bronze" community settings (#1146)
* The popular mirostat "Gold/Silver/Bronze" community settings

These settings have been popular in the community and are good
candidates for defaults.

* Update Miro Bronze.json

* Update Miro Gold.json

* Update Miro Bronze.json

* Update Miro Silver.json

* Rename Kobold presets

* Update textgen presets

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2023-09-17 16:39:02 +03:00
Cohee
d861c59f27 Merge branch 'release' into staging 2023-09-17 16:11:27 +03:00
Cohee
938f89cd1a Merge pull request #1143 from Xrystallized/async-getchat
Asynchronously fetch chats
2023-09-17 16:10:59 +03:00
RossAscends
acbd01407d Merge branch 'staging' of https://github.com/Cohee1207/SillyTavern into staging 2023-09-17 21:25:20 +09:00
RossAscends
254339af34 justify center default expressions in normal mode 2023-09-17 21:25:19 +09:00
Cohee
6c9cabfb57 Merge pull request #1145 from SillyTavern/release
Remove header #1144
2023-09-17 15:23:25 +03:00
Cohee
359277deb5 Remove header #1144 2023-09-17 15:21:26 +03:00
Cohee
11e7ca76e1 Use simpleGit to get app version 2023-09-17 14:27:41 +03:00
Cohee
dc1121b72a Remove tensorflow vector source. 2023-09-17 14:09:24 +03:00
RossAscends
323493962a fix oversized zoomed avatars again 2023-09-17 19:55:33 +09:00
RossAscends
751c0723dc skill issue: dont hide draggables on every keydown 2023-09-17 19:41:17 +09:00
Xrystal
23b08173ff Asynchronously fetch chats 2023-09-17 13:41:36 +08:00
RossAscends
9f15e67856 make zoomed avatars detectable by Escape hotkey 2023-09-17 05:17:02 +09:00
Cohee
2c84c93f3d Add thumbnails quality config 2023-09-16 21:53:30 +03:00
Cohee
bfdd071001 Move tokenizer endpoint and functions to separate file 2023-09-16 18:48:06 +03:00
Cohee
ab9aa28fe4 Move missed endpoints 2023-09-16 18:03:31 +03:00
Cohee
61995bb33f Move preset management into a separate file 2023-09-16 17:36:54 +03:00
Cohee
38b63b07f5 Extract sprite and custom content endpoints to a separate files. Update constants references 2023-09-16 17:28:28 +03:00
Cohee
d185e143a8 Merge branch 'staging' of https://github.com/SillyTavern/SillyTavern into staging 2023-09-16 16:39:16 +03:00
Cohee
4e1630c17d Extract endpoints for secrets and assets to separate files 2023-09-16 16:39:07 +03:00
RossAscends
2214f284fa free coloring even Blur turned off 2023-09-16 22:36:05 +09:00
Cohee
6e562bd1ff Extract server endpoints for thumbnails and extensions into separate files 2023-09-16 16:16:48 +03:00
RossAscends
2d774f32b2 custom colors for tag text 2023-09-16 18:37:19 +09:00
RossAscends
5ab449d8a1 missed one. 2023-09-16 15:48:28 +09:00
RossAscends
124658a006 Add Border Color Control 2023-09-16 15:42:26 +09:00
RossAscends
57de6229f9 Merge branch 'staging' of https://github.com/Cohee1207/SillyTavern into staging 2023-09-16 12:50:11 +09:00
RossAscends
e162df67fa partially fix quietPrompts (/sysgen) for Instruct 2023-09-16 12:48:14 +09:00
Cohee
dae09d58d7 Fix scroll top offset for new import flashing 2023-09-16 00:46:27 +03:00
Cohee
6dd09858d4 Don't remove names from the past chat. Fix non-streaming auto-continue.
We took fair criticism from the NovelAI dev.
2023-09-15 23:32:01 +03:00
Cohee
985c2bcfb1 Merge branch 'staging' of https://github.com/SillyTavern/SillyTavern into staging 2023-09-15 22:26:56 +03:00
Cohee
fc7a4538e9 Cancel auto-continue if user input is not empty 2023-09-15 22:26:53 +03:00
Cohee
72c672c2c2 Merge pull request #1136 from duncannah/fix-docker-post-install
Fix Docker by copying post-install.js into image
2023-09-15 21:59:27 +03:00
Cohee
77c8bc8eb5 Don't trigger auto-continue after quiet gens 2023-09-15 21:49:52 +03:00
duncannah
1edc2b08f2 Fix Docker by copying post-install.js into image 2023-09-15 20:44:48 +02:00
Cohee
d34f7d3e1a Replace multigen with auto-continue 2023-09-15 21:34:41 +03:00
Cohee
eaca6ddaf0 Don't try to resolve unknown tiktoken models 2023-09-15 19:31:17 +03:00
Cohee
aa89a74901 Merge branch 'staging' of https://github.com/SillyTavern/SillyTavern into staging 2023-09-15 17:59:42 +03:00
Cohee
599904d589 Move NovelAI endpoints to separate file 2023-09-15 17:54:13 +03:00
Chris Kaiser
ba302e4aa0 Added publishing of docker images on release (#1135)
* Added publishing of docker images on release

* Use proper project name

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2023-09-15 16:27:42 +03:00
Cohee
0f1a0963fd Merge branch 'release' into staging 2023-09-15 15:06:13 +03:00
Cohee
2b3055a84a Webp cards format is no longer supported 2023-09-15 14:56:15 +03:00
RossAscends
1fed8ba4f7 hotswap: instructions if no faves; no placeholders 2023-09-15 17:55:16 +09:00
Cohee
5827f9638f Fix /emote in groups 2023-09-15 01:17:24 +03:00
Cohee
6ad786f348 Add alternative local vectors source.
x5 speed boost!!
2023-09-14 23:40:13 +03:00
Cohee
0cc048cb64 Refactor transformers.js usage 2023-09-14 23:12:33 +03:00
Cohee
cb8d9ac71b Unset SD gen timeout 2023-09-14 21:49:29 +03:00
Cohee
b24509ef43 Visual touchup of custom expressions 2023-09-14 21:41:30 +03:00
Cohee
7553efc308 Custom char expressions 2023-09-14 21:30:02 +03:00
Cohee
9fb4b3425e Costume subfolders 2023-09-14 19:12:54 +03:00
Cohee
182216e711 /costume slash command 2023-09-14 18:37:13 +03:00
Cohee
52891898d2 Pass max length to Kobold GUI settings 2023-09-14 18:20:12 +03:00
Cohee
f6c29c61df Adjust Horde timeout to exactly 20 minutes (Horde's own limit). 2023-09-14 18:10:01 +03:00
Cohee
17a5d629ea Auto-set hotswap slot number based on the screen width. 2023-09-14 15:56:01 +03:00
Cohee
688551ffa6 #1128 Auto-Expand Message Actions 2023-09-14 15:23:51 +03:00
Cohee
ece34dc337 Move default files creation to post-install 2023-09-14 14:21:38 +03:00
Cohee
179de92231 Use transformers WASM binaries from a local folder 2023-09-14 14:11:37 +03:00
deffcolony
c4c962aeb9 issue template (#1126)
* seperated languages into structured folders

i18n.js needs to be connected to index.json so it fetches the common json files

* Update index.json

* New Launcher + security file

* cancel locales feature temporary

* added secrets to backup

* replaced download with winget

* fixed restoring backup bug

fixed bug that creates sillytavern\public folder inside sillytavern\public

* fixes date format

* launcher update + icon

* issue template

* old template no longer needed

* Delete .github/CODE_OF_CONDUCT.md

* Update bug-report.yml

* Update feature-request.yml

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2023-09-14 01:35:29 +03:00
Cohee
d0182c47de Fix expression BGM switch 2023-09-14 01:28:44 +03:00
Cohee
0d30d8244f Fix not applying ooba streaming url from server history 2023-09-13 18:07:06 +03:00
Cohee
2e67ebd881 Fix top bar gap (again) 2023-09-13 15:24:55 +03:00
Cohee
d62cdffcc0 Unblock amount_gen in Kobold GUI preset 2023-09-13 15:19:44 +03:00
Cohee
77a28c7131 Don't hide expressions menu if no chat open 2023-09-13 15:19:10 +03:00
Cohee
c60d4e5bb9 Merge branch 'staging' of https://github.com/SillyTavern/SillyTavern into staging 2023-09-13 13:21:47 +03:00
Cohee
990e08ba2d Fix top bar gap in mobile view 2023-09-13 13:21:42 +03:00
Cohee
bf0cf10403 Update hotswap state on fav 2023-09-13 13:12:19 +03:00
Jason Wu
7a3869c476 Enable Smart Context (ChromaDB) support within OpenAI API (#1125)
* Add JetBrains IDE .idea folder to .gitignore

* Enable Smart Context (ChromaDB) support within OpenAI API
2023-09-13 13:01:56 +03:00
mweldon
e74090139c Add copy to clipboard button on prompt itemization popup (#1124)
* Add copy to clipboard button on prompt itemization popup

* Minor fix for NovelAI Summarize and new bad words
2023-09-13 11:52:37 +03:00
Cohee
09fc42a787 Lock extensions display order in top and context menus 2023-09-13 01:40:01 +03:00
Cohee
c0e5d7efae Save chat scroll position when user input overflows the line 2023-09-13 00:51:21 +03:00
Cohee
66ec17620f Move Horde and SD endpoints into separate files 2023-09-12 20:45:36 +03:00
Cohee
51e2a3afcf Fix not being able to close the gallery on SD gens. 2023-09-12 19:23:33 +03:00
Cohee
abc1555c19 Merge branch 'vectors' into staging 2023-09-12 18:10:47 +03:00
Cohee
6c29879f12 Filter out undefined messages for past chats search 2023-09-12 18:05:37 +03:00
Cohee
2f8f6844fe Merge branch 'vectors' into staging 2023-09-12 15:49:47 +03:00
Cohee
dc4a6e862b Add local caption pipeline to UI plugin 2023-09-12 00:15:21 +03:00
RossAscends
4bf91c7772 clamp zoomed avatar widths to 400px as base 2023-09-12 02:09:18 +09:00
Cohee
004baf7b87 Reserve 3 extra tokens for each chat completion 2023-09-11 17:24:54 +03:00
Cohee
6c8bd06308 Reserve 3 extra tokens for each chat completion 2023-09-11 17:23:37 +03:00
Cohee
65b4551864 Reserve 3 extra tokens for each chat completion 2023-09-11 17:22:31 +03:00
Cohee
7f55d108cf Don't use talkinghead with local classification model 2023-09-11 13:01:45 +03:00
Cohee
c9a9dab523 Don't synchronize vectors when opening chat 2023-09-11 12:35:34 +03:00
Cohee
f149fc9aaa Endpoint for local captioning pipeline 2023-09-11 04:47:14 +03:00
Cohee
7aeb098212 Fix config access. Add Top K to classification results 2023-09-11 01:49:47 +03:00
Cohee
c76c76410c Add ability to override local classification model 2023-09-11 01:25:22 +03:00
Cohee
5cc6a2dca6 (WIP) Lazier chat loading 2023-09-11 01:07:45 +03:00
Cohee
0bdd350b8d Don't synchronize vectors while streaming 2023-09-10 20:21:23 +03:00
Cohee
9a5e667674 Throttle classification requests during streaming 2023-09-10 20:14:57 +03:00
Cohee
c9d8d7ba64 Fix vectorize all with no chat selected 2023-09-10 19:47:41 +03:00
Cohee
17367f2b17 Bump package version 2023-09-10 19:06:36 +03:00
Cohee
6362f76812 Set default DNS resolution order to IPv4 first 2023-09-10 19:04:11 +03:00
Cohee
74d627f674 Set default DNS resolution order to IPv4 first 2023-09-10 19:03:18 +03:00
Cohee
599261dc31 Set default DNS resolution order to IPv4 first 2023-09-10 19:02:58 +03:00
Cohee
d19c151669 Add DeepLX translation provider #1111 2023-09-10 18:53:52 +03:00
Cohee
b30d7ad51c Change net workaround for node 20 2023-09-10 18:24:32 +03:00
Cohee
4fdc533bd7 Change net workaround for node 20 2023-09-10 18:23:50 +03:00
Cohee
d17ac770e6 Change net workaround for node 20 2023-09-10 18:22:39 +03:00
Cohee
70071312d3 Add OneRingTranslator #521 2023-09-10 17:27:50 +03:00
Cohee
ec23356c99 Move translation endpoints into a separate file 2023-09-10 16:41:36 +03:00
Cohee
98cc969d18 Merge branch 'staging' into vectors 2023-09-10 16:06:15 +03:00
Cohee
dc5deaf47c Mobile doesn't like select2 2023-09-10 14:39:49 +03:00
Cohee
d81c94de0b Fix sort by date 2023-09-10 14:30:29 +03:00
Cohee
e2e32da4e6 Unrestrict console logs display limit 2023-09-10 04:12:14 +03:00
Cohee
0480acebcd #1059 Mancer model selector 2023-09-10 04:08:32 +03:00
Cohee
dbac2704f3 Rename control 2023-09-10 02:44:20 +03:00
Cohee
f8d90c1933 Merge branch 'staging' into vectors 2023-09-10 02:42:42 +03:00
Cohee
3dbdd1258e Don't close the panels when dismissing toasts 2023-09-10 02:30:23 +03:00
Cohee
f92249790f The return of permanent tokens display 2023-09-10 00:58:37 +03:00
Cohee
23951b8c8a Prevent sync and generation at the same time 2023-09-10 00:15:02 +03:00
Cohee
af38971a01 Delete vectors on deleting chats 2023-09-09 22:15:47 +03:00
Cohee
ed6417ebcd Display vectorization error in toast 2023-09-09 21:36:04 +03:00
Cohee
2fa038f91d Add advanced vector controls 2023-09-09 21:26:04 +03:00
Cohee
31beb05aa1 Substitute macro in Novel preamble 2023-09-09 18:19:01 +03:00
Cohee
4cf6a1f7da Cache and sample classification results 2023-09-09 17:31:27 +03:00
Cohee
180dcefe40 Patch onnx to always use wasm 2023-09-09 16:55:54 +03:00
Cohee
307e666c27 onnx runtime to web 2023-09-09 16:42:16 +03:00
Cohee
b605b940eb Replace transformers.js with patched version 2023-09-09 16:29:11 +03:00
Cohee
967a084aad (WIP) Local emotion classification pipeline 2023-09-09 15:14:16 +03:00
Cohee
4d08e3e9be Decrease batch size. Add browser console log 2023-09-09 15:12:54 +03:00
Cohee
da34517943 Merge branch 'staging' into vectors 2023-09-09 01:21:03 +03:00
kalomaze
7ffe3d21f8 Old Default context template (#1121)
Mirrors the old prompting style to a T. Can only be merged after the PR to add macros to the Example Separator + Chat Start is merged.
2023-09-08 23:04:51 +03:00
Cohee
ea01247bcf #1090 Save Kobold/ooba servers history 2023-09-08 22:44:06 +03:00
IkariDevGIT
786b87952e Quick-reply enhancements +fix (#1118)
* Update index.js

* change manual replace to substituteParams

* Update index.js
2023-09-08 21:38:31 +03:00
Cohee
26ddfd1a08 Continue with AltGr+Enter 2023-09-08 21:27:33 +03:00
Cohee
6f3947226f Merge pull request #1116 from ThisIsPIRI/macro
Replace macros in example separator and chat start
2023-09-08 21:10:20 +03:00
Cohee
42fd317188 Merge branch 'staging' into vectors 2023-09-08 16:41:26 +03:00
Cohee
2411b17279 Merge branch 'release' into staging 2023-09-08 16:40:45 +03:00
Cohee
ab460199ab #1117 Fix typing indicator and auto-scroll breaking mobile layout 2023-09-08 16:36:00 +03:00
Cohee
3a3ff89047 Add button to vectorize all chat 2023-09-08 15:25:10 +03:00
Cohee
a5acc7872d Add OpenAI vector source. 2023-09-08 13:57:27 +03:00
ThisIsPIRI
2688d980c1 Replace macros in example separator and chat start 2023-09-08 19:25:17 +09:00
Cohee
3abee9e37a Merge pull request #1115 from SillyTavern/release
Release
2023-09-08 12:48:37 +03:00
Cohee
5b63d0ff40 Merge pull request #1114 from ThisIsPIRI/tokenapi
Make API tokenization work again for ooba
2023-09-08 12:48:00 +03:00
ThisIsPIRI
a96aad6073 Make API tokenization work again for ooba 2023-09-08 18:31:30 +09:00
Cohee
02bdd56e20 Make printMessages async 2023-09-08 12:10:41 +03:00
Cohee
b5a6257352 Forgot that groups exist 2023-09-08 10:51:59 +03:00
Cohee
408a1fe846 Merge pull request #1112 from IkariDevGIT/gallerycommand
Add command for opening the gallery
2023-09-08 10:44:57 +03:00
RossAscends
44ba1cba59 Merge pull request #1113 from Hakirus/staging
Quick Reply Mod
2023-09-08 09:30:19 +09:00
Cohee
96df705409 Change insertion strategy to an extension block 2023-09-08 01:26:26 +03:00
Cohee
40f95bf842 Fix HypeBot plugin settings not saving 2023-09-08 00:30:31 +03:00
Cohee
9d45c0a018 Add UI plugin for vectors 2023-09-08 00:28:06 +03:00
EvilFear
470da71b3b Update index.js 2023-09-07 17:08:21 -04:00
Cohee
92ab17b58b Fix HypeBot plugin settings not saving 2023-09-07 22:28:53 +03:00
Cohee
8c00f38a1f Add local vectors storage 2023-09-07 21:53:47 +03:00
Cohee
89705391d1 Fix getSpriteFolderName function call 2023-09-07 17:52:37 +03:00
Cohee
bbe52886da Slash command to set sprite / emote. Also allow to do it per click even in online mode 2023-09-07 17:48:12 +03:00
IkariDevGIT
ef68dd07ac Add command for opening the gallery 2023-09-07 16:02:34 +02:00
anmelus
f2cae64b0d Added loop-around for swipe-left when multiple swipes exist (#1104)
* Added loop-around for swipe-left when multiple swipes exist

* Added loop around for alternate greetings in swipe_right(),
Disabled toast for add more alternate greetings

* Debounce saving swipes

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2023-09-07 16:45:19 +03:00
EvilFear
868778b079 Update index.js
Quick Reply Mod
2023-09-06 22:27:03 -04:00
Cohee
e681f1f36f #1069 Fix sort by date for v2 cards 2023-09-06 20:59:59 +03:00
Memerlin
1832145645 More spanish translation, fixed typo on index (#1103)
* More spanish translation, fixed typo on index

Praying that typo fix won't mess with the other translations. Changed "idel" for "idle".

* Update index.html

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2023-09-06 18:10:00 +03:00
Cohee
af4f60a4af Update Pygmalion context template. Add Pygmalion instruct template 2023-09-06 17:56:49 +03:00
Cohee
fa147f71a3 Merge branch 'release' into staging 2023-09-06 16:07:04 +03:00
Cohee
902676262a Delete Launcher.bat 2023-09-06 16:02:52 +03:00
252 changed files with 26439 additions and 14393 deletions

90
.github/ISSUE_TEMPLATE/bug-report.yml vendored Normal file
View File

@@ -0,0 +1,90 @@
name: Bug Report 🐛
description: Report something that's not working the intended way. Support requests for external programs (reverse proxies, 3rd party servers, other peoples' forks) will be refused!
title: '[BUG] <title>'
labels: ['bug']
body:
- type: dropdown
id: environment
attributes:
label: Environment
description: Where are you running SillyTavern?
options:
- Self-Hosted (Bare Metal)
- Self-Hosted (Docker)
- Android (Termux)
- Cloud Service (Static)
- Other (Specify below)
validations:
required: true
- type: input
id: system
attributes:
label: System
description: >-
For deployment issues, specify your [distro or OS](https://whatsmyos.com/) and/ or Docker version.
For client-side issues, include your [browser version](https://www.whatsmybrowser.org/)
placeholder: e.g. Firefox 101, Manjaro Linux 21.3.0, Docker 20.10.16
validations:
required: true
- type: input
id: version
attributes:
label: Version
description: What version of SillyTavern are you running?
placeholder: (check User Settings to see the version)
validations:
required: true
- type: textarea
id: desktop
attributes:
label: Desktop Information
description: Please provide details about your desktop environment.
placeholder: |
- Node.js version (if applicable): [run `node --version` in cmd]
- Generation API [e.g. KoboldAI, OpenAI]
- Branch [staging, release]
- Model [e.g. Pygmalion 6b, LLaMa 13b]
validations:
required: false
- type: textarea
id: repro
attributes:
label: Describe the problem
description: Please describe exactly what is not working, include the steps to reproduce, actual result and expected result
placeholder: When doing ABC then DEF, I expect to see XYZ, but I actually see ZYX
validations:
required: true
- type: textarea
id: logs
attributes:
label: Additional info
description: Logs? Screenshots? Yes, please.
placeholder: If the issue happens during build-time, include terminal logs. For run-time errors, include browser logs which you can view in the Dev Tools (F12), under the Console tab. Take care to blank out any personal info.
validations:
required: false
- type: checkboxes
id: idiot-check
attributes:
label: Please tick the boxes
description: Before submitting, please ensure that
options:
- label: You have explained the issue clearly, and included all relevant info
required: true
- label: You've checked that this [issue hasn't already been raised](https://github.com/SillyTavern/SillyTavern/issues?q=is%3Aissue)
required: true
- label: You've checked the [docs](https://docs.sillytavern.app/) ![important](https://img.shields.io/badge/Important!-F6094E)
required: true
- type: markdown
attributes:
value: |-
## Thanks 🙏
Thank you for raising this ticket - in doing so you are helping to make SillyTavern better for everyone.
validations:
required: false

View File

@@ -1,45 +0,0 @@
---
name: Bug report
about: "Create a report to help us improve. PAY ATTENTION: Support requests for external programs (reverse proxies, 3rd party servers, other peoples' forks) will be refused!"
title: "[BUG]"
labels: ''
assignees: ''
---
> **Warning**. Complete **all** the fields below. Otherwise, your bug report will be **ignored**!
**Have you searched for similar [bugs](https://github.com/SillyTavern/SillyTavern/issues?q=)?**
Yes/No
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Logs**
Providing the logs from the browser DevTools console (opened by pressing the F12 key) or SillyTavern command line window will be highly appreciated.
**Desktop (please complete the following information):**
- OS/Device: [e.g. Windows 11]
- Environment: [cloud, local]
- Node.js version (if applicable): [run `node --version` in cmd]
- Browser [e.g. chrome, safari]
- Generation API [e.g. KoboldAI, OpenAI]
- Branch [staging, release]
- Model [e.g. Pygmalion 6b, LLaMa 13b]
**Additional context**
Add any other context about the problem here.

View File

@@ -0,0 +1,91 @@
name: Feature Request ✨
description: Suggest an idea for future development of this project
title: '[FEATURE_REQUEST] <title>'
labels: ['enhancement']
body:
# Field 1 - Did the user searched for similar requests
- type: dropdown
id: similarRequest
attributes:
label: Have you searched for similar requests?
description:
options:
- 'No'
- 'Yes'
validations:
required: false
# Field 2 - Is it bug-related
- type: textarea
id: issue
attributes:
label: Is your feature request related to a problem? If so, please describe.
description:
placeholder: A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
validations:
required: false
# Field 3 - Describe feature
- type: textarea
id: solution
attributes:
label: Describe the solution you'd like
placeholder: An outline of how you would like this to be implemented, include as much details as possible
validations:
required: true
# Field 4 - Describe alternatives
- type: textarea
id: alternatives
attributes:
label: Describe alternatives you've considered
placeholder: A clear and concise description of any alternative solutions or features you've considered.
validations:
required: false
# Field 5 - Additional context
- type: textarea
id: addcontext
attributes:
label: Additional context
placeholder: Add any other context or screenshots about the feature request here.
validations:
required: false
# Field 6 - Priority
- type: dropdown
id: priority
attributes:
label: Priority
description: How urgent is the development of this feature
options:
- Low (Nice-to-have)
- Medium (Would be very useful)
- High (The app does not function without it)
validations:
required: true
# Field 7 - Can the user implement
- type: dropdown
id: canImplement
attributes:
label: Is this something you would be keen to implement?
description: Are you raising this ticket in order to get an issue number for your PR?
options:
- 'No'
- 'Maybe'
- 'Yes!'
validations:
required: false
# Final text
- type: markdown
attributes:
value: |-
## Thanks 🙏
Thank you for your feature suggestion.
Please note that there is no guarantee that your idea will be implemented.
validations:
required: false

View File

@@ -1,23 +0,0 @@
---
name: Feature request
about: Suggest an idea for this project
title: "[Feature Request] "
labels: ''
assignees: ''
---
**Have you searched for similar [requests](https://github.com/SillyTavern/SillyTavern/issues?q=)?**
Yes/No
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.

View File

@@ -1,8 +1,8 @@
[English](readme.md) | 中文
![image](https://github.com/SillyTavern/SillyTavern/assets/18619528/8c41a061-7f72-4d2b-9d54-e6d058209e7b)
![image](https://github.com/SillyTavern/SillyTavern/assets/18619528/c2be4c3f-aada-4f64-87a3-ae35a68b61a4)
移动设备界面友好多种人工智能服务或模型支持KoboldAI/CPP, Horde, NovelAI, Ooba, OpenAI, OpenRouter, Claude, Scale类似 Galgame 的 老 婆 模 式Horde SD文本系统语音生成世界信息Lorebooks可定制的界面自动翻译和比你所需要的更多的 Prompt。附带扩展服务支持文本绘画生成与语音生成和基于向量数据库 ChromaDB 的聊天信息总结。
移动设备界面友好多种人工智能服务或模型支持KoboldAI/CPP, Horde, NovelAI, Ooba, OpenAI, OpenRouter, Claude, Scale类似 Galgame 的 老 婆 模 式Horde SD文本系统语音生成世界信息Lorebooks可定制的界面自动翻译和比你所需要的更多的 Prompt。附带扩展服务支持文本绘画生成与语音生成和基于向量数据库 的聊天信息总结。
基于 TavernAI 1.2.8 的分叉版本
@@ -41,8 +41,6 @@ SillyTavern 本身并无用处,因为它只是一个用户聊天界面。你
<https://rentry.org/STAI-Termux>
Termux 不支持**.Webp 字符卡的导入/导出。请使用 JSON 或 PNG 格式**。
## 有问题或建议?
### 我们现在有了 Discord 社区
@@ -83,7 +81,6 @@ SillyTavern 支持扩展服务,一些额外的人工智能模块可通过 [Sil
* 在聊天窗口发送图片,并由人工智能解释图片内容
* 文本图像生成5 预设,以及 "自由模式"
* 聊天信息的文字转语音(通过 ElevenLabs、Silero 或操作系统的语音生成)
* ChromaDB 向量数据库,用于更智能的聊天 Prompt
扩展服务的完整功能介绍和使用教程,请参阅 [Docs](https://docs.sillytavern.app/extras/extensions/)。
@@ -173,7 +170,7 @@ SillyTavern 会将 API 密钥保存在目录中的 `secrets.json` 文件内。
如果要想通过点击 API 输入框旁边的按钮来查看密钥,请按照以下设置:
1. 打开 `config.conf` 文件,将里面的 `allowKeysExposure` 设置为 `true`
1. 打开 `config.yaml` 文件,将里面的 `allowKeysExposure` 设置为 `true`
2. 然后重启 SillyTavern 服务。
## 远程访问
@@ -210,7 +207,7 @@ SillyTavern 会将 API 密钥保存在目录中的 `secrets.json` 文件内。
然后,文件中设置的 IP 就可以访问 SillyTavern 了。
*注意:"config.conf" 文件内也有一个 "whitelist" 设置,你可以用同样的方法设置它,但如果 "whitelist.txt" 文件存在,这个设置将被忽略。
*注意:"config.yaml" 文件内也有一个 "whitelist" 设置,你可以用同样的方法设置它,但如果 "whitelist.txt" 文件存在,这个设置将被忽略。
### 2.获取 SillyTavern 服务的 IP 地址
@@ -236,19 +233,19 @@ SillyTavern 会将 API 密钥保存在目录中的 `secrets.json` 文件内。
### 向所有 IP 开放您的 SillyTavern 服务
我们不建议这样做,但您可以打开 `config.conf` 并将里面的 `whitelist` 设置改为 `false`
我们不建议这样做,但您可以打开 `config.yaml` 并将里面的 `whitelistMode` 设置改为 `false`
你必须删除或重命名SillyTavern 文件夹中的 `whitelist.txt` 文件(如果有的话)。
这通常是不安全的做法,所以我们要求在这样做时必须设置用户名和密码。
用户名和密码在`config.conf`文件中设置。
用户名和密码在`config.yaml`文件中设置。
重启 SillyTavern 服务后,只要知道用户名和密码,任何设备都可以访问。
### 还是无法访问?
*`config.conf` 文件中的端口创建一条入站/出站防火墙规则。切勿将此误认为是路由器上的端口转发,否则,有人可能会发现你的聊天隐私,那就大错特错了。
*`config.yaml` 文件中的端口创建一条入站/出站防火墙规则。切勿将此误认为是路由器上的端口转发,否则,有人可能会发现你的聊天隐私,那就大错特错了。
* 在 "设置" > "网络和 Internet" > "以太网" 中启用 "专用网络" 配置。这对 Windows 11 非常重要,否则即使添加了上述防火墙规则也无法连接。
### 性能问题?

37
.github/readme.md vendored
View File

@@ -1,15 +1,19 @@
English | [中文](readme-zh_cn.md)
![image](https://github.com/SillyTavern/SillyTavern/assets/18619528/8c41a061-7f72-4d2b-9d54-e6d058209e7b)
![SillyTavern-Banner](https://github.com/SillyTavern/SillyTavern/assets/18619528/c2be4c3f-aada-4f64-87a3-ae35a68b61a4)
Mobile-friendly, Multi-API (KoboldAI/CPP, Horde, NovelAI, Ooba, OpenAI, OpenRouter, Claude, Scale), VN-like Waifu Mode, Horde SD, System TTS, WorldInfo (lorebooks), customizable UI, auto-translate, and more prompt options than you'd ever want or need. Optional Extras server for more SD/TTS options + ChromaDB/Summarize.
Mobile-friendly layout, Multi-API (KoboldAI/CPP, Horde, NovelAI, Ooba, OpenAI, OpenRouter, Claude, Scale), VN-like Waifu Mode, Stable Diffusion, TTS, WorldInfo (lorebooks), customizable UI, auto-translate, and more prompt options than you'd ever want or need + ability to install third-party extensions.
Based on a fork of TavernAI 1.2.8
Based on a fork of [TavernAI](https://github.com/TavernAI/TavernAI) 1.2.8
## Important news!
1. We have created a [Documentation website](https://docs.sillytavern.app/) to answer most of your questions and help you get started.
2. Missing extensions after the update? Since the 1.10.6 release version, most of the previously built-in extensions have been converted to downloadable add-ons. You can download them via the built-in "Download Extensions and Assets" menu in the extensions panel (stacked blocks icon in the top bar).
### Brought to you by Cohee, RossAscends, and the SillyTavern community
NOTE: We have created a [Documentation website](https://docs.sillytavern.app/) to answer most of your questions and help you get started.
### What is SillyTavern or TavernAI?
SillyTavern is a user interface you can install on your computer (and Android phones) that allows you to interact with text generation AIs and chat/roleplay with characters you or the community create.
@@ -41,8 +45,6 @@ Since Tavern is only a user interface, it has tiny hardware requirements, it wil
<https://rentry.org/STAI-Termux>
**.webp character cards import/export is not supported in Termux. Use either JSON or PNG formats instead.**
## Questions or suggestions?
### We now have a community Discord server
@@ -71,7 +73,6 @@ Get in touch with the developers directly:
* [Oobabooga's TextGen WebUI](https://github.com/oobabooga/text-generation-webui) API connection
* [AI Horde](https://horde.koboldai.net/) connection
* Prompt generation formatting tweaking
* webp character card interoperability (PNG is still an internal format)
## Extensions
@@ -83,7 +84,6 @@ SillyTavern has extensibility support, with some additional AI modules hosted vi
* Sending images to chat, and the AI interpreting the content
* Stable Diffusion image generation (5 chat-related presets plus 'free mode')
* Text-to-speech for AI response messages (via ElevenLabs, Silero, or the OS's System TTS)
* ChromaDB vector storage for smarter chat prompt formatting
A full list of included extensions and tutorials on how to use them can be found in the [Docs](https://docs.sillytavern.app/extras/extensions/).
@@ -162,8 +162,10 @@ Installing via ZIP download (discouraged)
### Linux
1. Run the `start.sh` script.
2. Enjoy.
1. Ensure you have Node.js v18 or higher (the latest [LTS version](https://nodejs.org/en/download/) is recommended) installed by running `node -v`.
Alternatively, use the [Node Version Manager](https://github.com/nvm-sh/nvm#installing-and-updating) script to quickly and easily manage your Node installations.
2. Run the `start.sh` script.
3. Enjoy.
## API keys management
@@ -173,7 +175,7 @@ By default, they will not be exposed to a frontend after you enter them and relo
In order to enable viewing your keys by clicking a button in the API block:
1. Set the value of `allowKeysExposure` to `true` in `config.conf` file.
1. Set the value of `allowKeysExposure` to `true` in `config.yaml` file.
2. Restart the SillyTavern server.
## Remote connections
@@ -211,7 +213,7 @@ CIDR masks are also accepted (eg. 10.0.0.0/24).
Now devices which have the IP specified in the file will be able to connect.
*Note: `config.conf` also has a `whitelist` array, which you can use in the same way, but this array will be ignored if `whitelist.txt` exists.*
*Note: `config.yaml` also has a `whitelist` array, which you can use in the same way, but this array will be ignored if `whitelist.txt` exists.*
### 2. Getting the IP for the ST host machine
@@ -223,7 +225,7 @@ If the ST-hosting device is on the same wifi network, you will use the ST-host's
If you (or someone else) want to connect to your hosted ST while not being on the same network, you will need the public IP of your ST-hosting device.
* While using the ST-hosting device, access [this page](https://whatismyipaddress.com/) and look for for `IPv4`. This is what you would use to connect from the remote device.
* While using the ST-hosting device, access [this page](https://whatismyipaddress.com/) and look for `IPv4`. This is what you would use to connect from the remote device.
### 3. Connect the remote device to the ST host machine
@@ -237,19 +239,19 @@ Use http:// NOT https://
### Opening your ST to all IPs
We do not recommend doing this, but you can open `config.conf` and change `whitelist` to `false`.
We do not recommend doing this, but you can open `config.yaml` and change `whitelistMode` to `false`.
You must remove (or rename) `whitelist.txt` in the SillyTavern base install folder if it exists.
This is usually an insecure practice, so we require you to set a username and password when you do this.
The username and password are set in `config.conf`.
The username and password are set in `config.yaml`.
After restarting your ST server, any device will be able to connect to it, regardless of their IP as long as they know the username and password.
### Still Unable To Connect?
* Create an inbound/outbound firewall rule for the port found in `config.conf`. Do NOT mistake this for port-forwarding on your router, otherwise, someone could find your chat logs and that's a big no-no.
* Create an inbound/outbound firewall rule for the port found in `config.yaml`. Do NOT mistake this for port-forwarding on your router, otherwise, someone could find your chat logs and that's a big no-no.
* Enable the Private Network profile type in Settings > Network and Internet > Ethernet. This is VERY important for Windows 11, otherwise, you would be unable to connect even with the aforementioned firewall rules.
## Performance issues?
@@ -295,6 +297,7 @@ GNU Affero General Public License for more details.**
* RossAscends' additions: AGPL v3
* Portions of CncAnon's TavernAITurbo mod: Unknown license
* kingbri's various commits and suggestions (<https://github.com/bdashore3>)
* city_unit's extensions and various QoL features (<https://github.com/city-unit>)
* StefanDanielSchwarz's various commits and bug reports (<https://github.com/StefanDanielSchwarz>)
* Waifu mode inspired by the work of PepperTaco (<https://github.com/peppertaco/Tavern/>)
* Thanks Pygmalion University for being awesome testers and suggesting cool features!

45
.github/workflows/docker-publish.yml vendored Normal file
View File

@@ -0,0 +1,45 @@
# This workflow will publish a docker image for every full release to the GitHub package repository
name: Create Docker Image on Release
on:
release:
# Only runs on full releases not pre releases
types: [released]
env:
# This should allow creation of docker images even in forked repositories
# Image name may not contain uppercase characters, so we can not use the repository name
# Creates a string like: ghcr.io/SillyTavern/sillytavern
image_name: ghcr.io/sillytavern/sillytavern
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
# Build docker image using dockerfile and tag it with branch name
# Assumes branch name is the version number
- name: Build the Docker image
run: |
docker build . --file Dockerfile --tag $image_name:${{ github.ref_name }}
# Login into package repository as the person who created the release
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# Assumes release is the latest and marks image as such
- name: Docker Tag and Push
run: |
docker tag $image_name:${{ github.ref_name }} $image_name:latest
docker push $image_name:${{ github.ref_name }}
docker push $image_name:latest

6
.gitignore vendored
View File

@@ -20,12 +20,15 @@ public/stats.json
/uploads/
*.jsonl
/config.conf
/config.yaml
/config.conf.bak
/docker/config
.DS_Store
public/settings.json
/thumbnails
whitelist.txt
.vscode
.idea/
secrets.json
/dist
/backups/
@@ -35,3 +38,6 @@ content.log
cloudflared.exe
public/assets/
access.log
/vectors/
/cache/
public/css/user.css

View File

@@ -13,7 +13,7 @@ ENTRYPOINT [ "tini", "--" ]
WORKDIR ${APP_HOME}
# Install app dependencies
COPY package*.json ./
COPY package*.json post-install.js ./
RUN \
echo "*** Install npm packages ***" && \
npm install && npm cache clean --force
@@ -23,18 +23,19 @@ COPY . ./
# Copy default chats, characters and user avatars to <folder>.default folder
RUN \
IFS="," RESOURCES="characters,chats,groups,group chats,User Avatars,worlds" && \
IFS="," RESOURCES="assets,backgrounds,user,context,instruct,QuickReplies,movingUI,themes,characters,chats,groups,group chats,User Avatars,worlds,OpenAI Settings,NovelAI Settings,KoboldAI Settings,TextGen Settings" && \
\
echo "*** Store default $RESOURCES in <folder>.default ***" && \
for R in $RESOURCES; do mv "public/$R" "public/$R.default"; done && \
for R in $RESOURCES; do mv "public/$R" "public/$R.default"; done || true && \
\
echo "*** Create symbolic links to config directory ***" && \
for R in $RESOURCES; do ln -s "../config/$R" "public/$R"; done && \
# rm "config.conf" "public/settings.json" "public/css/bg_load.css" && \
ln -s "./config/config.conf" "config.conf" && \
ln -s "../config/settings.json" "public/settings.json" && \
ln -s "../../config/bg_load.css" "public/css/bg_load.css" && \
mkdir "config"
for R in $RESOURCES; do ln -s "../config/$R" "public/$R"; done || true && \
\
rm -f "config.yaml" "public/settings.json" "public/css/bg_load.css" || true && \
ln -s "./config/config.yaml" "config.yaml" || true && \
ln -s "../config/settings.json" "public/settings.json" || true && \
ln -s "../../config/bg_load.css" "public/css/bg_load.css" || true && \
mkdir "config" || true
# Cleanup unnecessary files
RUN \

View File

@@ -4,7 +4,7 @@ echo WARNING: Cloudflare Tunnel!
echo ========================================================================================================================
echo This script downloads and runs the latest cloudflared.exe from Cloudflare to set up an HTTPS tunnel to your SillyTavern!
echo Using the randomly generated temporary tunnel URL, anyone can access your SillyTavern over the Internet while the tunnel
echo is active. Keep the URL safe and secure your SillyTavern installation by setting a username and password in config.conf!
echo is active. Keep the URL safe and secure your SillyTavern installation by setting a username and password in config.yaml!
echo.
echo See https://docs.sillytavern.app/usage/remoteconnections/ for more details about how to secure your SillyTavern install.
echo.

View File

@@ -34,45 +34,59 @@
"source": [
"#@markdown (RECOMMENDED) Generates an API key for you to use with the API\n",
"secure = False #@param {type:\"boolean\"}\n",
"#@markdown Enables hosting of extensions backend for SillyTavern Extras\n",
"use_cpu = False #@param {type:\"boolean\"}\n",
"#@markdown Allows to run SillyTavern Extras on CPU (use if you're out of daily GPU allowance)\n",
"use_sd_cpu = False #@param {type:\"boolean\"}\n",
"use_cpu = False #@param {type:\"boolean\"}\n",
"#@markdown Allows to run Stable Diffusion pipeline on CPU (slow!)\n",
"extras_enable_captioning = True #@param {type:\"boolean\"}\n",
"use_sd_cpu = False #@param {type:\"boolean\"}\n",
"#@markdown ***\n",
"#@markdown Loads the image captioning module\n",
"Captions_Model = \"Salesforce/blip-image-captioning-large\" #@param [ \"Salesforce/blip-image-captioning-large\", \"Salesforce/blip-image-captioning-base\" ]\n",
"extras_enable_caption = True #@param {type:\"boolean\"}\n",
"captioning_model = \"Salesforce/blip-image-captioning-large\" #@param [ \"Salesforce/blip-image-captioning-large\", \"Salesforce/blip-image-captioning-base\" ]\n",
"#@markdown * Salesforce/blip-image-captioning-large - good base model\n",
"#@markdown * Salesforce/blip-image-captioning-base - slightly faster but less accurate\n",
"extras_enable_emotions = True #@param {type:\"boolean\"}\n",
"#@markdown ***\n",
"#@markdown Loads the sentiment classification model\n",
"Emotions_Model = \"nateraw/bert-base-uncased-emotion\" #@param [\"nateraw/bert-base-uncased-emotion\", \"joeddav/distilbert-base-uncased-go-emotions-student\"]\n",
"extras_enable_classify = True #@param {type:\"boolean\"}\n",
"classification_model = \"nateraw/bert-base-uncased-emotion\" #@param [\"nateraw/bert-base-uncased-emotion\", \"joeddav/distilbert-base-uncased-go-emotions-student\"]\n",
"#@markdown * nateraw/bert-base-uncased-emotion = 6 supported emotions<br>\n",
"#@markdown * joeddav/distilbert-base-uncased-go-emotions-student = 28 supported emotions\n",
"extras_enable_memory = True #@param {type:\"boolean\"}\n",
"#@markdown ***\n",
"#@markdown Loads the story summarization module\n",
"Memory_Model = \"slauw87/bart_summarisation\" #@param [ \"slauw87/bart_summarisation\", \"Qiliang/bart-large-cnn-samsum-ChatGPT_v3\", \"Qiliang/bart-large-cnn-samsum-ElectrifAi_v10\", \"distilbart-xsum-12-3\" ]\n",
"extras_enable_summarize = True #@param {type:\"boolean\"}\n",
"summarization_model = \"slauw87/bart_summarisation\" #@param [ \"slauw87/bart_summarisation\", \"Qiliang/bart-large-cnn-samsum-ChatGPT_v3\", \"Qiliang/bart-large-cnn-samsum-ElectrifAi_v10\", \"distilbart-xsum-12-3\" ]\n",
"#@markdown * slauw87/bart_summarisation - general purpose summarization model\n",
"#@markdown * Qiliang/bart-large-cnn-samsum-ChatGPT_v3 - summarization model optimized for chats\n",
"#@markdown * Qiliang/bart-large-cnn-samsum-ElectrifAi_v10 - nice results so far, but still being evaluated\n",
"#@markdown * distilbart-xsum-12-3 - faster, but pretty basic alternative\n",
"extras_enable_silero_tts = True #@param {type:\"boolean\"}\n",
"#@markdown ***\n",
"#@markdown Enables Silero text-to-speech module\n",
"extras_enable_edge_tts = True #@param {type:\"boolean\"}\n",
"extras_enable_silero_tts = True #@param {type:\"boolean\"}\n",
"#@markdown Enables Microsoft Edge text-to-speech module\n",
"extras_enable_sd = True #@param {type:\"boolean\"}\n",
"extras_enable_edge_tts = True #@param {type:\"boolean\"}\n",
"#@markdown Enables RVC module\n",
"extras_enable_rvc = False #@param {type:\"boolean\"}\n",
"#@markdown ***\n",
"#@markdown Enables Whisper speech recognition module\n",
"extras_enable_whisper_stt = True #@param {type:\"boolean\"}\n",
"whisper_model = \"base.en\" #@param [ \"tiny.en\", \"base.en\", \"small.en\", \"medium.en\", \"tiny\", \"base\", \"small\", \"medium\", \"large\" ]\n",
"#@markdown There are five model sizes, four with English-only versions, offering speed and accuracy tradeoffs.\n",
"#@markdown The .en models for English-only applications tend to perform better, especially for the tiny.en and base.en models.\n",
"#@markdown ***\n",
"#@markdown Enables SD picture generation\n",
"SD_Model = \"ckpt/anything-v4.5-vae-swapped\" #@param [ \"ckpt/anything-v4.5-vae-swapped\", \"hakurei/waifu-diffusion\", \"philz1337/clarity\", \"prompthero/openjourney\", \"ckpt/sd15\", \"stabilityai/stable-diffusion-2-1-base\" ]\n",
"extras_enable_sd = True #@param {type:\"boolean\"}\n",
"sd_model = \"ckpt/anything-v4.5-vae-swapped\" #@param [ \"ckpt/anything-v4.5-vae-swapped\", \"hakurei/waifu-diffusion\", \"philz1337/clarity\", \"prompthero/openjourney\", \"ckpt/sd15\", \"stabilityai/stable-diffusion-2-1-base\" ]\n",
"#@markdown * ckpt/anything-v4.5-vae-swapped - anime style model\n",
"#@markdown * hakurei/waifu-diffusion - anime style model\n",
"#@markdown * philz1337/clarity - realistic style model\n",
"#@markdown * prompthero/openjourney - midjourney style model\n",
"#@markdown * ckpt/sd15 - base SD 1.5\n",
"#@markdown * stabilityai/stable-diffusion-2-1-base - base SD 2.1\n",
"#@markdown ***\n",
"#@markdown Enables ChromaDB module\n",
"extras_enable_chromadb = True #@param {type:\"boolean\"}\n",
"#@markdown Enables ChromaDB for Infinity Context plugin\n",
"\n",
"import subprocess\n",
"import secrets\n",
"\n",
"# ---\n",
"# SillyTavern extras\n",
@@ -85,28 +99,36 @@
"if secure:\n",
" params.append('--secure')\n",
"params.append('--share')\n",
"ExtrasModules = []\n",
"modules = []\n",
"\n",
"if (extras_enable_captioning):\n",
" ExtrasModules.append('caption')\n",
"if (extras_enable_memory):\n",
" ExtrasModules.append('summarize')\n",
"if (extras_enable_emotions):\n",
" ExtrasModules.append('classify')\n",
"if (extras_enable_sd):\n",
" ExtrasModules.append('sd')\n",
"if (extras_enable_silero_tts):\n",
" ExtrasModules.append('silero-tts')\n",
"if extras_enable_caption:\n",
" modules.append('caption')\n",
"if extras_enable_summarize:\n",
" modules.append('summarize')\n",
"if extras_enable_classify:\n",
" modules.append('classify')\n",
"if extras_enable_sd:\n",
" modules.append('sd')\n",
"if extras_enable_silero_tts:\n",
" modules.append('silero-tts')\n",
"if extras_enable_edge_tts:\n",
" ExtrasModules.append('edge-tts')\n",
"if (extras_enable_chromadb):\n",
" ExtrasModules.append('chromadb')\n",
" modules.append('edge-tts')\n",
"if extras_enable_chromadb:\n",
" modules.append('chromadb')\n",
"if extras_enable_whisper_stt:\n",
" modules.append('whisper-stt')\n",
" params.append(f'--stt-whisper-model-path={whisper_model}')\n",
"if extras_enable_rvc:\n",
" modules.append('rvc')\n",
" params.append('--max-content-length=2000')\n",
" params.append('--rvc-save-file')\n",
"\n",
"params.append(f'--classification-model={Emotions_Model}')\n",
"params.append(f'--summarization-model={Memory_Model}')\n",
"params.append(f'--captioning-model={Captions_Model}')\n",
"params.append(f'--sd-model={SD_Model}')\n",
"params.append(f'--enable-modules={\",\".join(ExtrasModules)}')\n",
"\n",
"params.append(f'--classification-model={classification_model}')\n",
"params.append(f'--summarization-model={summarization_model}')\n",
"params.append(f'--captioning-model={captioning_model}')\n",
"params.append(f'--sd-model={sd_model}')\n",
"params.append(f'--enable-modules={\",\".join(modules)}')\n",
"\n",
"\n",
"%cd /\n",
@@ -114,22 +136,21 @@
"%cd /SillyTavern-extras\n",
"!git clone https://github.com/Cohee1207/tts_samples\n",
"!npm install -g localtunnel\n",
"!pip install -r requirements-complete.txt\n",
"!pip install tensorflow==2.12\n",
"!pip install Flask-Cors\n",
"!pip install Flask-Compress\n",
"!pip install transformers\n",
"!pip install Flask_Cloudflared\n",
"!pip install webuiapi\n",
"!pip install diffusers\n",
"!pip install accelerate\n",
"!pip install silero_api_server\n",
"!pip install edge_tts\n",
"!pip install chromadb\n",
"!pip install sentence_transformers\n",
"%pip install -r requirements.txt\n",
"!wget https://github.com/cloudflare/cloudflared/releases/download/2023.5.0/cloudflared-linux-amd64 -O /tmp/cloudflared-linux-amd64\n",
"!chmod +x /tmp/cloudflared-linux-amd64\n",
"\n",
"if extras_enable_rvc:\n",
" print(\"Installing RVC requirements\")\n",
" !pip install -r requirements-rvc.txt\n",
"\n",
"# Generate a random API key\n",
"api_key = secrets.token_hex(5)\n",
"\n",
"# Write the API key to api_key.txt\n",
"with open('./api_key.txt', 'w') as f:\n",
" f.write(api_key)\n",
"print(f\"API Key generated: {api_key}\")\n",
"\n",
"cmd = f\"python server.py {' '.join(params)}\"\n",
"print(cmd)\n",

View File

@@ -1,35 +0,0 @@
const port = 8000;
const whitelist = ['127.0.0.1']; //Example for add several IP in whitelist: ['127.0.0.1', '192.168.0.10']
const whitelistMode = true; //Disabling enabling the ip whitelist mode. true/false
const basicAuthMode = false; //Toggle basic authentication for endpoints.
const basicAuthUser = {username: "user", password: "password"}; //Login credentials when basicAuthMode is true.
const disableThumbnails = false; //Disables the generation of thumbnails, opting to use the raw images instead
const autorun = true; //Autorun in the browser. true/false
const enableExtensions = true; //Enables support for TavernAI-extras project
const listen = true; // If true, Can be access from other device or PC. otherwise can be access only from hosting machine.
const allowKeysExposure = false; // If true, private API keys could be fetched to the frontend.
const skipContentCheck = false; // If true, no new default content will be delivered to you.
// If true, Allows insecure settings for listen, whitelist, and authentication.
// Change this setting only on "trusted networks". Do not change this value unless you are aware of the issues that can arise from changing this setting and configuring a insecure setting.
const securityOverride = false;
// Request overrides for additional headers
const requestOverrides = [];
module.exports = {
port,
whitelist,
whitelistMode,
basicAuthMode,
basicAuthUser,
autorun,
enableExtensions,
listen,
disableThumbnails,
allowKeysExposure,
securityOverride,
skipContentCheck,
requestOverrides,
};

53
default/config.yaml Normal file
View File

@@ -0,0 +1,53 @@
# -- NETWORK CONFIGURATION --
# Listen for incoming connections
listen: true
# Server port
port: 8000
# Toggle whitelist mode
whitelistMode: true
# Whitelist of allowed IP addresses
whitelist:
- 127.0.0.1
# Toggle basic authentication for endpoints
basicAuthMode: false
# Basic authentication credentials
basicAuthUser:
username: user
password: password
# Enables CORS proxy middleware
enableCorsProxy: false
# Disable security checks - NOT RECOMMENDED
securityOverride: false
# -- ADVANCED CONFIGURATION --
# Open the browser automatically
autorun: true
# Disable thumbnail generation
disableThumbnails: false
# Thumbnail quality (0-100)
thumbnailsQuality: 95
# Allow secret keys exposure via API
allowKeysExposure: false
# Skip new default content checks
skipContentCheck: false
# Disable automatic chats backup
disableChatBackup: false
# API request overrides (for KoboldAI and Text Completion APIs)
## Format is an array of objects:
## - hosts:
## - example.com
## headers:
## Content-Type: application/json
requestOverrides: []
# -- PLUGIN CONFIGURATION --
# Enable UI extensions
enableExtensions: true
# Extension settings
extras:
# Disables automatic model download from HuggingFace
disableAutoDownload: false
# Extra models for plugins. Expects model IDs from HuggingFace model hub in ONNX format
classificationModel: Cohee/distilbert-base-uncased-go-emotions-onnx
captioningModel: Xenova/vit-gpt2-image-captioning
embeddingModel: Xenova/all-mpnet-base-v2
promptExpansionModel: Cohee/fooocus_expansion-onnx

View File

@@ -0,0 +1,86 @@
{
"3": {
"class_type": "KSampler",
"inputs": {
"cfg": "%scale%",
"denoise": 1,
"latent_image": [
"5",
0
],
"model": [
"4",
0
],
"negative": [
"7",
0
],
"positive": [
"6",
0
],
"sampler_name": "%sampler%",
"scheduler": "%scheduler%",
"seed": "%seed%",
"steps": "%steps%"
}
},
"4": {
"class_type": "CheckpointLoaderSimple",
"inputs": {
"ckpt_name": "%model%"
}
},
"5": {
"class_type": "EmptyLatentImage",
"inputs": {
"batch_size": 1,
"height": "%height%",
"width": "%width%"
}
},
"6": {
"class_type": "CLIPTextEncode",
"inputs": {
"clip": [
"4",
1
],
"text": "%prompt%"
}
},
"7": {
"class_type": "CLIPTextEncode",
"inputs": {
"clip": [
"4",
1
],
"text": "%negative_prompt%"
}
},
"8": {
"class_type": "VAEDecode",
"inputs": {
"samples": [
"3",
0
],
"vae": [
"4",
2
]
}
},
"9": {
"class_type": "SaveImage",
"inputs": {
"filename_prefix": "SillyTavern",
"images": [
"8",
0
]
}
}
}

View File

@@ -22,5 +22,9 @@
{
"filename": "user-default.png",
"type": "avatar"
},
{
"filename": "Default_Comfy_Workflow.json",
"type": "workflow"
}
]

View File

@@ -49,7 +49,6 @@
"ban_eos_token": false,
"skip_special_tokens": true,
"streaming": false,
"streaming_url": "ws://127.0.0.1:5005/api/v1/stream",
"mirostat_mode": 0,
"mirostat_tau": 5,
"mirostat_eta": 0.1,
@@ -75,9 +74,6 @@
"always_force_name2": true,
"user_prompt_bias": "",
"show_user_prompt_bias": true,
"multigen": false,
"multigen_first_chunk": 50,
"multigen_next_chunks": 30,
"markdown_escape_strings": "",
"fast_ui_mode": false,
"avatar_style": 0,
@@ -167,7 +163,8 @@
"custom_stopping_strings_macro": true,
"fuzzy_search": true,
"encode_tags": false,
"lazy_load": 100,
"enableLabMode": false,
"enableZenSliders": false,
"ui_mode": 1
},
"extension_settings": {
@@ -409,8 +406,6 @@
"typical": 1,
"tfs": 1,
"rep_pen_slope": 0,
"single_line": false,
"use_stop_sequence": false,
"streaming_kobold": false,
"sampler_order": [
6,
@@ -420,7 +415,12 @@
3,
4,
5
]
],
"mirostat": 0,
"mirostat_tau": 5,
"mirostat_eta": 0.1,
"use_default_badwordsids": false,
"grammar": ""
},
"oai_settings": {
"preset_settings_openai": "Default",

1
default/user.css Normal file
View File

@@ -0,0 +1 @@
/* Put custom styles here. */

View File

@@ -4,9 +4,10 @@ services:
build: ..
container_name: sillytavern
hostname: sillytavern
image: sillytavern/sillytavern:latest
image: ghcr.io/sillytavern/sillytavern:latest
ports:
- "8000:8000"
volumes:
- "./config:/home/node/app/config"
- "./user:/home/node/app/public/user"
restart: unless-stopped

View File

@@ -1,7 +1,7 @@
#!/bin/sh
# Initialize missing user files
IFS="," RESOURCES="characters,groups,group chats,chats,User Avatars,worlds"
IFS="," RESOURCES="assets,backgrounds,user,context,instruct,QuickReplies,movingUI,themes,characters,chats,groups,group chats,User Avatars,worlds,OpenAI Settings,NovelAI Settings,KoboldAI Settings,TextGen Settings"
for R in $RESOURCES; do
if [ ! -e "config/$R" ]; then
echo "Resource not found, copying from defaults: $R"
@@ -9,9 +9,9 @@ for R in $RESOURCES; do
fi
done
if [ ! -e "config/config.conf" ]; then
echo "Resource not found, copying from defaults: config.conf"
cp -r "default/config.conf" "config/config.conf"
if [ ! -e "config/config.yaml" ]; then
echo "Resource not found, copying from defaults: config.yaml"
cp -r "default/config.yaml" "config/config.yaml"
fi
if [ ! -e "config/settings.json" ]; then
@@ -24,5 +24,20 @@ if [ ! -e "config/bg_load.css" ]; then
cp -r "default/bg_load.css" "config/bg_load.css"
fi
CONFIG_FILE="config.yaml"
echo "Starting with the following config:"
cat $CONFIG_FILE
if grep -q "listen: false" $CONFIG_FILE; then
echo -e "\033[1;31mThe listen parameter is set to false. If you can't connect to the server, edit the \"docker/config/config.yaml\" file and restart the container.\033[0m"
sleep 5
fi
if grep -q "whitelistMode: true" $CONFIG_FILE; then
echo -e "\033[1;31mThe whitelistMode parameter is set to true. If you can't connect to the server, edit the \"docker/config/config.yaml\" file and restart the container.\033[0m"
sleep 5
fi
# Start the server
exec node server.js

1361
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -3,43 +3,46 @@
"@agnai/sentencepiece-js": "^1.1.1",
"@agnai/web-tokenizers": "^0.1.3",
"@dqbd/tiktoken": "^1.0.2",
"bing-translate-api": "^2.9.1",
"command-exists": "^1.2.9",
"compression": "^1",
"cookie-parser": "^1.4.6",
"cors": "^2.8.5",
"csrf-csrf": "^2.2.3",
"device-detector-js": "^3.0.3",
"exifreader": "^4.12.0",
"express": "^4.18.2",
"form-data": "^4.0.0",
"google-translate-api-browser": "^3.0.1",
"gpt3-tokenizer": "^1.1.5",
"ip-matching": "^2.1.2",
"ipaddr.js": "^2.0.1",
"jimp": "^0.22.7",
"jquery": "^3.6.4",
"jimp": "^0.22.10",
"json5": "^2.2.3",
"lodash": "^4.17.21",
"mime-types": "^2.1.35",
"multer": "^1.4.5-lts.1",
"node-fetch": "^2.6.11",
"open": "^8.4.2",
"piexifjs": "^1.0.6",
"png-chunk-text": "^1.0.0",
"png-chunks-encode": "^1.0.0",
"png-chunks-extract": "^1.0.0",
"response-time": "^2.3.2",
"sanitize-filename": "^1.6.3",
"sillytavern-transformers": "^2.7.3",
"simple-git": "^3.19.1",
"uniqolor": "^1.1.0",
"webp-converter": "2.3.2",
"vectra": "^0.2.2",
"write-file-atomic": "^5.0.1",
"ws": "^8.13.0",
"yaml": "^2.3.4",
"yargs": "^17.7.1",
"yauzl": "^2.10.0"
},
"overrides": {
"parse-bmfont-xml": {
"xml2js": "^0.5.0"
},
"vectra": {
"openai": "^4.17.0"
}
},
"name": "sillytavern",
@@ -49,11 +52,12 @@
"type": "git",
"url": "https://github.com/SillyTavern/SillyTavern.git"
},
"version": "1.10.2",
"version": "1.10.10",
"scripts": {
"start": "node server.js",
"start-multi": "node server.js --disableCsrf",
"pkg": "pkg --compress Gzip --no-bytecode --public ."
"pkg": "pkg --compress Gzip --no-bytecode --public .",
"postinstall": "node post-install.js"
},
"bin": {
"sillytavern": "./server.js"
@@ -78,6 +82,7 @@
]
},
"devDependencies": {
"jquery": "^3.6.4",
"pkg": "^5.8.1",
"pkg-fetch": "^3.5.2"
}

182
post-install.js Normal file
View File

@@ -0,0 +1,182 @@
/**
* Scripts to be done before starting the server for the first time.
*/
const fs = require('fs');
const path = require('path');
const crypto = require('crypto');
const yaml = require('yaml');
const _ = require('lodash');
/**
* Colorizes console output.
*/
const color = {
byNum: (mess, fgNum) => {
mess = mess || '';
fgNum = fgNum === undefined ? 31 : fgNum;
return '\u001b[' + fgNum + 'm' + mess + '\u001b[39m';
},
black: (mess) => color.byNum(mess, 30),
red: (mess) => color.byNum(mess, 31),
green: (mess) => color.byNum(mess, 32),
yellow: (mess) => color.byNum(mess, 33),
blue: (mess) => color.byNum(mess, 34),
magenta: (mess) => color.byNum(mess, 35),
cyan: (mess) => color.byNum(mess, 36),
white: (mess) => color.byNum(mess, 37)
};
/**
* Gets all keys from an object recursively.
* @param {object} obj Object to get all keys from
* @param {string} prefix Prefix to prepend to all keys
* @returns {string[]} Array of all keys in the object
*/
function getAllKeys(obj, prefix = '') {
if (typeof obj !== 'object' || Array.isArray(obj)) {
return [];
}
return _.flatMap(Object.keys(obj), key => {
const newPrefix = prefix ? `${prefix}.${key}` : key;
if (typeof obj[key] === 'object' && !Array.isArray(obj[key])) {
return getAllKeys(obj[key], newPrefix);
} else {
return [newPrefix];
}
});
}
/**
* Converts the old config.conf file to the new config.yaml format.
*/
function convertConfig() {
if (fs.existsSync('./config.conf')) {
if (fs.existsSync('./config.yaml')) {
console.log(color.yellow('Both config.conf and config.yaml exist. Please delete config.conf manually.'));
return;
}
try {
console.log(color.blue('Converting config.conf to config.yaml. Your old config.conf will be renamed to config.conf.bak'));
const config = require(path.join(process.cwd(), './config.conf'));
fs.renameSync('./config.conf', './config.conf.bak');
fs.writeFileSync('./config.yaml', yaml.stringify(config));
console.log(color.green('Conversion successful. Please check your config.yaml and fix it if necessary.'));
} catch (error) {
console.error(color.red('FATAL: Config conversion failed. Please check your config.conf file and try again.'));
return;
}
}
}
/**
* Compares the current config.yaml with the default config.yaml and adds any missing values.
*/
function addMissingConfigValues() {
try {
const defaultConfig = yaml.parse(fs.readFileSync(path.join(process.cwd(), './default/config.yaml'), 'utf8'));
let config = yaml.parse(fs.readFileSync(path.join(process.cwd(), './config.yaml'), 'utf8'));
// Get all keys from the original config
const originalKeys = getAllKeys(config);
// Use lodash's defaultsDeep function to recursively apply default properties
config = _.defaultsDeep(config, defaultConfig);
// Get all keys from the updated config
const updatedKeys = getAllKeys(config);
// Find the keys that were added
const addedKeys = _.difference(updatedKeys, originalKeys);
if (addedKeys.length === 0) {
return;
}
console.log('Adding missing config values to config.yaml:', addedKeys);
fs.writeFileSync('./config.yaml', yaml.stringify(config));
} catch (error) {
console.error(color.red('FATAL: Could not add missing config values to config.yaml'), error);
}
}
/**
* Creates the default config files if they don't exist yet.
*/
function createDefaultFiles() {
const files = {
settings: './public/settings.json',
bg_load: './public/css/bg_load.css',
config: './config.yaml',
user: './public/css/user.css',
};
for (const file of Object.values(files)) {
try {
if (!fs.existsSync(file)) {
const defaultFilePath = path.join('./default', path.parse(file).base);
fs.copyFileSync(defaultFilePath, file);
console.log(color.green(`Created default file: ${file}`));
}
} catch (error) {
console.error(color.red(`FATAL: Could not write default file: ${file}`), error);
}
}
}
/**
* Returns the MD5 hash of the given data.
* @param {Buffer} data Input data
* @returns {string} MD5 hash of the input data
*/
function getMd5Hash(data) {
return crypto
.createHash('md5')
.update(data)
.digest('hex');
}
/**
* Copies the WASM binaries from the sillytavern-transformers package to the dist folder.
*/
function copyWasmFiles() {
if (!fs.existsSync('./dist')) {
fs.mkdirSync('./dist');
}
const listDir = fs.readdirSync('./node_modules/sillytavern-transformers/dist');
for (const file of listDir) {
if (file.endsWith('.wasm')) {
const sourcePath = `./node_modules/sillytavern-transformers/dist/${file}`;
const targetPath = `./dist/${file}`;
// Don't copy if the file already exists and is the same checksum
if (fs.existsSync(targetPath)) {
const sourceChecksum = getMd5Hash(fs.readFileSync(sourcePath));
const targetChecksum = getMd5Hash(fs.readFileSync(targetPath));
if (sourceChecksum === targetChecksum) {
continue;
}
}
fs.copyFileSync(sourcePath, targetPath);
console.log(`${file} successfully copied to ./dist/${file}`);
}
}
}
try {
// 0. Convert config.conf to config.yaml
convertConfig();
// 1. Create default config files
createDefaultFiles();
// 2. Copy transformers WASM binaries from node_modules
copyWasmFiles();
// 3. Add missing config values
addMissingConfigValues();
} catch (error) {
console.error(error);
}

View File

@@ -1,12 +1,12 @@
{
"temp": 1.15,
"top_k": 0,
"top_p": 0.95,
"top_a": 0,
"typical": 1,
"tfs": 0.8,
"rep_pen": 1.05,
"rep_pen_range": 2048,
"top_p": 0.95,
"top_a": 0,
"top_k": 0,
"typical": 1,
"tfs": 0.8,
"rep_pen_slope": 7,
"sampler_order": [
6,
@@ -16,5 +16,9 @@
5,
1,
4
]
],
"mirostat": 0,
"mirostat_tau": 5,
"mirostat_eta": 0.1,
"grammar": ""
}

View File

@@ -1,12 +1,12 @@
{
"temp": 0.59,
"top_k": 0,
"top_p": 1,
"top_a": 0,
"typical": 1,
"tfs": 0.87,
"rep_pen": 1.1,
"rep_pen_range": 2048,
"top_p": 1,
"top_a": 0,
"top_k": 0,
"typical": 1,
"tfs": 0.87,
"rep_pen_slope": 0.3,
"sampler_order": [
6,
@@ -16,5 +16,9 @@
3,
1,
4
]
],
"mirostat": 0,
"mirostat_tau": 5,
"mirostat_eta": 0.1,
"grammar": ""
}

View File

@@ -1,12 +1,12 @@
{
"temp": 0.8,
"top_k": 100,
"top_p": 0.9,
"top_a": 0,
"typical": 1,
"tfs": 1,
"rep_pen": 1.15,
"rep_pen_range": 2048,
"top_p": 0.9,
"top_a": 0,
"top_k": 100,
"typical": 1,
"tfs": 1,
"rep_pen_slope": 3.4,
"sampler_order": [
6,
@@ -16,5 +16,9 @@
3,
1,
4
]
],
"mirostat": 0,
"mirostat_tau": 5,
"mirostat_eta": 0.1,
"grammar": ""
}

View File

@@ -1,12 +1,12 @@
{
"temp": 0.51,
"top_p": 1,
"top_k": 0,
"tfs": 0.99,
"top_a": 0,
"typical": 1,
"rep_pen": 1.2,
"rep_pen_range": 2048,
"top_p": 1,
"top_a": 0,
"top_k": 0,
"typical": 1,
"tfs": 0.99,
"rep_pen_slope": 0,
"sampler_order": [
6,
@@ -16,5 +16,9 @@
3,
1,
4
]
],
"mirostat": 0,
"mirostat_tau": 5,
"mirostat_eta": 0.1,
"grammar": ""
}

View File

@@ -8,7 +8,6 @@
"typical": 1,
"tfs": 1,
"rep_pen_slope": 0,
"single_line": false,
"sampler_order": [
6,
0,
@@ -17,5 +16,9 @@
4,
2,
5
]
}
],
"mirostat": 0,
"mirostat_tau": 5,
"mirostat_eta": 0.1,
"grammar": ""
}

View File

@@ -1,12 +1,12 @@
{
"temp": 0.63,
"top_k": 0,
"top_p": 0.98,
"top_a": 0,
"typical": 1,
"tfs": 0.98,
"rep_pen": 1.05,
"rep_pen_range": 2048,
"top_p": 0.98,
"top_a": 0,
"top_k": 0,
"typical": 1,
"tfs": 0.98,
"rep_pen_slope": 0.1,
"sampler_order": [
6,
@@ -16,5 +16,9 @@
5,
1,
4
]
],
"mirostat": 0,
"mirostat_tau": 5,
"mirostat_eta": 0.1,
"grammar": ""
}

View File

@@ -1,12 +1,12 @@
{
"temp": 0.7,
"top_k": 0,
"top_p": 0.5,
"top_a": 0.75,
"typical": 0.19,
"tfs": 0.97,
"rep_pen": 1.1,
"rep_pen_range": 1024,
"top_p": 0.5,
"top_a": 0.75,
"top_k": 0,
"typical": 0.19,
"tfs": 0.97,
"rep_pen_slope": 0.7,
"sampler_order": [
6,
@@ -16,5 +16,9 @@
2,
1,
0
]
],
"mirostat": 0,
"mirostat_tau": 5,
"mirostat_eta": 0.1,
"grammar": ""
}

View File

@@ -1,12 +1,12 @@
{
"temp": 0.7,
"top_k": 0,
"top_p": 1,
"top_a": 0,
"typical": 1,
"tfs": 0.9,
"rep_pen": 1.1,
"rep_pen_range": 1024,
"top_p": 1,
"top_a": 0,
"top_k": 0,
"typical": 1,
"tfs": 0.9,
"rep_pen_slope": 0.7,
"sampler_order": [
6,
@@ -16,5 +16,9 @@
3,
4,
5
]
],
"mirostat": 0,
"mirostat_tau": 5,
"mirostat_eta": 0.1,
"grammar": ""
}

View File

@@ -1,12 +1,12 @@
{
"temp": 0.66,
"top_k": 0,
"top_p": 1,
"top_a": 0.96,
"typical": 0.6,
"tfs": 1,
"rep_pen": 1.1,
"rep_pen_range": 1024,
"top_p": 1,
"top_a": 0.96,
"top_k": 0,
"typical": 0.6,
"tfs": 1,
"rep_pen_slope": 0.7,
"sampler_order": [
6,
@@ -16,5 +16,9 @@
0,
2,
3
]
],
"mirostat": 0,
"mirostat_tau": 5,
"mirostat_eta": 0.1,
"grammar": ""
}

View File

@@ -1,12 +1,12 @@
{
"temp": 0.94,
"top_k": 12,
"top_p": 1,
"top_a": 0,
"typical": 1,
"tfs": 0.94,
"rep_pen": 1.05,
"rep_pen_range": 2048,
"top_p": 1,
"top_a": 0,
"top_k": 12,
"typical": 1,
"tfs": 0.94,
"rep_pen_slope": 0.2,
"sampler_order": [
6,
@@ -16,5 +16,9 @@
3,
1,
4
]
],
"mirostat": 0,
"mirostat_tau": 5,
"mirostat_eta": 0.1,
"grammar": ""
}

View File

@@ -1,12 +1,12 @@
{
"temp": 1.5,
"top_k": 85,
"top_p": 0.24,
"top_a": 0,
"typical": 1,
"tfs": 1,
"rep_pen": 1.1,
"rep_pen_range": 2048,
"top_p": 0.24,
"top_a": 0,
"top_k": 85,
"typical": 1,
"tfs": 1,
"rep_pen_slope": 0,
"sampler_order": [
6,
@@ -16,5 +16,9 @@
3,
1,
4
]
],
"mirostat": 0,
"mirostat_tau": 5,
"mirostat_eta": 0.1,
"grammar": ""
}

View File

@@ -1,12 +1,12 @@
{
"temp": 1.05,
"top_k": 0,
"top_p": 0.95,
"top_a": 0,
"typical": 1,
"tfs": 1,
"rep_pen": 1.1,
"rep_pen_range": 1024,
"top_p": 0.95,
"top_a": 0,
"top_k": 0,
"typical": 1,
"tfs": 1,
"rep_pen_slope": 0.7,
"sampler_order": [
6,
@@ -16,5 +16,9 @@
3,
4,
5
]
],
"mirostat": 0,
"mirostat_tau": 5,
"mirostat_eta": 0.1,
"grammar": ""
}

View File

@@ -0,0 +1,24 @@
{
"temp": 1.06,
"rep_pen": 1,
"rep_pen_range": 0,
"top_p": 1,
"top_a": 0,
"top_k": 0,
"typical": 1,
"tfs": 1,
"rep_pen_slope": 0.9,
"sampler_order": [
6,
0,
1,
3,
4,
2,
5
],
"mirostat": 2,
"mirostat_tau": 9.61,
"mirostat_eta": 1,
"grammar": ""
}

View File

@@ -0,0 +1,24 @@
{
"temp": 1.17,
"rep_pen": 1,
"rep_pen_range": 0,
"top_p": 1,
"top_a": 0,
"top_k": 0,
"typical": 1,
"tfs": 1,
"rep_pen_slope": 0.9,
"sampler_order": [
6,
0,
1,
3,
4,
2,
5
],
"mirostat": 2,
"mirostat_tau": 9.91,
"mirostat_eta": 1,
"grammar": ""
}

View File

@@ -0,0 +1,24 @@
{
"temp": 1.17,
"rep_pen": 1,
"rep_pen_range": 0,
"top_p": 1,
"top_a": 0,
"top_k": 0,
"typical": 1,
"tfs": 1,
"rep_pen_slope": 0.9,
"sampler_order": [
6,
0,
1,
3,
4,
2,
5
],
"mirostat": 2,
"mirostat_tau": 9.62,
"mirostat_eta": 1,
"grammar": ""
}

View File

@@ -1,12 +1,12 @@
{
"temp": 1.07,
"top_k": 100,
"top_p": 1,
"top_a": 0,
"typical": 1,
"tfs": 0.93,
"rep_pen": 1.05,
"rep_pen_range": 404,
"top_p": 1,
"top_a": 0,
"top_k": 100,
"typical": 1,
"tfs": 0.93,
"rep_pen_slope": 0.8,
"sampler_order": [
6,
@@ -16,5 +16,9 @@
2,
1,
4
]
],
"mirostat": 0,
"mirostat_tau": 5,
"mirostat_eta": 0.1,
"grammar": ""
}

View File

@@ -1,12 +1,12 @@
{
"temp": 0.44,
"top_k": 0,
"top_p": 1,
"top_a": 0,
"typical": 1,
"tfs": 0.9,
"rep_pen": 1.15,
"rep_pen_range": 2048,
"top_p": 1,
"top_a": 0,
"top_k": 0,
"typical": 1,
"tfs": 0.9,
"rep_pen_slope": 6.8,
"sampler_order": [
6,
@@ -16,5 +16,9 @@
3,
1,
4
]
],
"mirostat": 0,
"mirostat_tau": 5,
"mirostat_eta": 0.1,
"grammar": ""
}

View File

@@ -1,12 +1,12 @@
{
"temp": 1.35,
"top_k": 0,
"top_p": 1,
"top_a": 0,
"typical": 1,
"tfs": 0.69,
"rep_pen": 1.15,
"rep_pen_range": 2048,
"top_p": 1,
"top_a": 0,
"top_k": 0,
"typical": 1,
"tfs": 0.69,
"rep_pen_slope": 0.1,
"sampler_order": [
6,
@@ -16,5 +16,9 @@
0,
1,
4
]
],
"mirostat": 0,
"mirostat_tau": 5,
"mirostat_eta": 0.1,
"grammar": ""
}

View File

@@ -1,12 +1,12 @@
{
"temp": 1,
"top_k": 0,
"top_p": 0.95,
"top_a": 0,
"typical": 1,
"tfs": 1,
"rep_pen": 1.1,
"rep_pen_range": 600,
"top_p": 0.95,
"top_a": 0,
"top_k": 0,
"typical": 1,
"tfs": 1,
"rep_pen_slope": 0,
"sampler_order": [
6,
@@ -16,5 +16,9 @@
3,
4,
5
]
}
],
"mirostat": 0,
"mirostat_tau": 5,
"mirostat_eta": 0.1,
"grammar": ""
}

View File

@@ -8,7 +8,6 @@
"typical": 1,
"tfs": 1,
"rep_pen_slope": 0,
"single_line": false,
"sampler_order": [
6,
0,
@@ -17,5 +16,9 @@
4,
2,
5
]
}
],
"mirostat": 0,
"mirostat_tau": 5,
"mirostat_eta": 0.1,
"grammar": ""
}

View File

@@ -1,12 +1,12 @@
{
"temp": 0.72,
"tfs": 1,
"top_a": 0,
"top_k": 0,
"top_p": 0.73,
"typical": 1,
"rep_pen": 1.1,
"rep_pen_range": 2048,
"top_p": 0.73,
"top_a": 0,
"top_k": 0,
"typical": 1,
"tfs": 1,
"rep_pen_slope": 0.2,
"sampler_order": [
6,
@@ -16,5 +16,9 @@
3,
1,
4
]
],
"mirostat": 0,
"mirostat_tau": 5,
"mirostat_eta": 0.1,
"grammar": ""
}

View File

@@ -8,7 +8,6 @@
"typical": 1,
"tfs": 0.95,
"rep_pen_slope": 0,
"single_line": false,
"sampler_order": [
6,
0,
@@ -17,5 +16,9 @@
4,
2,
5
]
}
],
"mirostat": 0,
"mirostat_tau": 5,
"mirostat_eta": 0.1,
"grammar": ""
}

View File

@@ -8,7 +8,6 @@
"typical": 1,
"tfs": 1,
"rep_pen_slope": 0,
"single_line": false,
"sampler_order": [
6,
0,
@@ -17,5 +16,9 @@
4,
2,
5
]
}
],
"mirostat": 0,
"mirostat_tau": 5,
"mirostat_eta": 0.1,
"grammar": ""
}

View File

@@ -8,7 +8,6 @@
"typical": 1,
"tfs": 1,
"rep_pen_slope": 0,
"single_line": false,
"sampler_order": [
6,
0,
@@ -17,5 +16,9 @@
4,
2,
5
]
}
],
"mirostat": 0,
"mirostat_tau": 5,
"mirostat_eta": 0.1,
"grammar": ""
}

View File

@@ -0,0 +1,24 @@
{
"temp": 1.06,
"top_p": 1,
"top_k": 0,
"typical_p": 1,
"top_a": 0,
"tfs": 1,
"epsilon_cutoff": 0,
"eta_cutoff": 0,
"rep_pen": 1,
"rep_pen_range": 0,
"no_repeat_ngram_size": 0,
"penalty_alpha": 0,
"num_beams": 1,
"length_penalty": 1,
"min_length": 0,
"encoder_rep_pen": 1,
"do_sample": true,
"early_stopping": false,
"mirostat_mode": 2,
"mirostat_tau": 9.61,
"mirostat_eta": 1,
"rep_pen_size": 0
}

View File

@@ -0,0 +1,24 @@
{
"temp": 1.17,
"top_p": 1,
"top_k": 0,
"typical_p": 1,
"top_a": 0,
"tfs": 1,
"epsilon_cutoff": 0,
"eta_cutoff": 0,
"rep_pen": 1,
"rep_pen_range": 0,
"no_repeat_ngram_size": 0,
"penalty_alpha": 0,
"num_beams": 1,
"length_penalty": 1,
"min_length": 0,
"encoder_rep_pen": 1,
"do_sample": true,
"early_stopping": false,
"mirostat_mode": 2,
"mirostat_tau": 9.91,
"mirostat_eta": 1,
"rep_pen_size": 0
}

View File

@@ -0,0 +1,24 @@
{
"temp": 1.17,
"top_p": 1,
"top_k": 0,
"typical_p": 1,
"top_a": 0,
"tfs": 1,
"epsilon_cutoff": 0,
"eta_cutoff": 0,
"rep_pen": 1,
"rep_pen_range": 0,
"no_repeat_ngram_size": 0,
"penalty_alpha": 0,
"num_beams": 1,
"length_penalty": 1,
"min_length": 0,
"encoder_rep_pen": 1,
"do_sample": true,
"early_stopping": false,
"mirostat_mode": 2,
"mirostat_tau": 9.62,
"mirostat_eta": 1,
"rep_pen_size": 0
}

View File

@@ -0,0 +1 @@
Put blip audio files here

View File

@@ -0,0 +1 @@
Put live2d model folders here

View File

@@ -0,0 +1,10 @@
{
"story_string": "{{#if system}}{{system}}\n{{/if}}{{#if wiBefore}}{{wiBefore}}\n{{/if}}{{#if description}}{{description}}\n{{/if}}{{#if personality}}{{personality}}\n{{/if}}{{#if scenario}}{{scenario}}\n{{/if}}{{#if wiAfter}}{{wiAfter}}\n{{/if}}{{#if persona}}{{persona}}\n{{/if}}",
"example_separator": "",
"chat_start": "",
"always_force_name2": false,
"trim_sentences": false,
"include_newline": false,
"single_line": true,
"name": "Adventure"
}

View File

@@ -0,0 +1,6 @@
{
"story_string": "<|im_start|>system\n{{#if system}}{{system}}\n{{/if}}{{#if wiBefore}}{{wiBefore}}\n{{/if}}{{#if description}}{{description}}\n{{/if}}{{#if personality}}{{char}}'s personality: {{personality}}\n{{/if}}{{#if scenario}}Scenario: {{scenario}}\n{{/if}}{{#if wiAfter}}{{wiAfter}}\n{{/if}}{{#if persona}}{{persona}}\n{{/if}}<|im_end|>",
"chat_start": "",
"example_separator": "",
"name": "ChatML"
}

View File

@@ -0,0 +1,6 @@
{
"story_string": "### Instruction:\nWrite {{char}}'s next reply in this roleplay with {{user}}. Use the provided character sheet and example dialogue for formatting direction and character speech patterns.\n\n{{#if system}}{{system}}\n\n{{/if}}### Character Sheet:\n{{#if wiBefore}}{{wiBefore}}\n{{/if}}{{#if description}}{{description}}\n{{/if}}{{#if personality}}{{char}}'s personality: {{personality}}\n{{/if}}{{#if scenario}}Scenario: {{scenario}}\n{{/if}}{{#if wiAfter}}{{wiAfter}}\n{{/if}}{{#if persona}}{{persona}}\n{{/if}}",
"chat_start": "### START ROLEPLAY:",
"example_separator": "### Example:",
"name": "Libra-32B"
}

View File

@@ -0,0 +1,6 @@
{
"story_string": "{{system}}\n{{#if wiBefore}}{{wiBefore}}\n{{/if}}{{#if description}}{{char}}'s description:{{description}}\n{{/if}}{{#if personality}}{{char}}'s personality:{{personality}}\n{{/if}}{{#if scenario}}Scenario: {{scenario}}\n{{/if}}{{#if wiAfter}}{{wiAfter}}\n{{/if}}{{#if persona}}{{user}}'s persona: {{persona}}\n{{/if}}",
"chat_start": "This is the history of the roleplay:",
"example_separator": "Example of an interaction:",
"name": "Lightning 1.1"
}

View File

@@ -0,0 +1,6 @@
{
"story_string": "[INST] {{#if system}}{{system}}\n{{/if}}{{#if wiBefore}}{{wiBefore}}\n{{/if}}{{#if description}}{{description}}\n{{/if}}{{#if personality}}{{char}}'s personality: {{personality}}\n{{/if}}{{#if scenario}}Scenario: {{scenario}}\n{{/if}}{{#if wiAfter}}{{wiAfter}}\n{{/if}}{{#if persona}}{{persona}}\n{{/if}}[/INST]",
"chat_start": "",
"example_separator": "Examples:",
"name": "Mistral"
}

View File

@@ -0,0 +1,6 @@
{
"story_string": "{{#if system}}{{system}}\n{{/if}}{{#if wiBefore}}{{wiBefore}}\n{{/if}}{{#if description}}{{description}}\n{{/if}}{{#if personality}}{{char}}'s personality: {{personality}}\n{{/if}}{{#if scenario}}Circumstances and context of the dialogue: {{scenario}}\n{{/if}}{{#if wiAfter}}{{wiAfter}}\n{{/if}}{{#if persona}}{{persona}}\n{{/if}}",
"chat_start": "\nThen the roleplay chat between {{user}} and {{char}} begins.\n",
"example_separator": "This is how {{char}} should talk",
"name": "OldDefault"
}

View File

@@ -1,6 +1,6 @@
{
"name": "Pygmalion",
"story_string": "{{#if system}}{{system}}\n{{/if}}{{#if wiBefore}}{{wiBefore}}\n{{/if}}{{#if description}}{{{char}}}'s Persona: {{description}}\n{{/if}}{{#if personality}}Personality: {{personality}}\n{{/if}}{{#if scenario}}Scenario: {{scenario}}\n{{/if}}{{#if wiAfter}}{{wiAfter}}\n{{/if}}{{#if persona}}{{persona}}\n{{/if}}",
"chat_start": "<START>",
"example_separator": "<START>"
"story_string": "{{#if system}}{{system}}\n{{/if}}{{#if wiBefore}}{{wiBefore}}\n{{/if}}{{#if description}}{{description}}\n{{/if}}{{#if personality}}{{char}}'s personality: {{personality}}\n{{/if}}{{#if scenario}}Scenario: {{scenario}}\n{{/if}}{{#if wiAfter}}{{wiAfter}}\n{{/if}}{{#if persona}}{{persona}}\n{{/if}}",
"chat_start": "",
"example_separator": ""
}

View File

@@ -0,0 +1,6 @@
{
"story_string": "{{#if system}}{{system}}\n{{/if}}{{#if wiBefore}}{{wiBefore}}\n{{/if}}{{#if description}}{{description}}\n{{/if}}{{#if personality}}{{personality}}\n{{/if}}{{#if scenario}}{{scenario}}\n{{/if}}{{#if wiAfter}}{{wiAfter}}\n{{/if}}{{#if persona}}{{persona}}\n{{/if}}",
"chat_start": "",
"example_separator": "",
"name": "Story"
}

View File

@@ -0,0 +1,105 @@
#rm_print_characters_block.group_overlay_mode_select .character_select {
transition: background-color 0.4s ease;
margin-bottom: 1px;
background-color: rgba(170, 170, 170, 0.15);
}
#rm_print_characters_block.group_overlay_mode_select .bogus_folder_select,
#rm_print_characters_block.group_overlay_mode_select .group_select {
cursor: auto;
filter: saturate(0.3);
}
#rm_print_characters_block.group_overlay_mode_select .bogus_folder_select:hover,
#rm_print_characters_block.group_overlay_mode_select .group_select:hover {
background: none;
}
#rm_print_characters_block.group_overlay_mode_select .character_select input.bulk_select_checkbox {
display: none !important;
}
#rm_print_characters_block.group_overlay_mode_select .character_select.character_selected {
background-color: var(--SmartThemeQuoteColor);
}
#rm_print_characters_block.group_overlay_mode_select .character_select .bulk_select_checkbox {
visibility: hidden;
height: 0 !important;
}
#character_context_menu.hidden { display: none; }
#character_context_menu {
position: absolute;
padding: 3px;
z-index: 9998;
background-color: var(--black90a);
border: 1px solid var(--black90a);
border-radius: 10px;
}
#character_context_menu ul li button {
border: 0;
border-bottom-color: currentcolor;
color: var(--SmartThemeQuoteColor);
background-color: transparent;
font-weight: bold;
font-size: 1em;
padding: 0.5em;
border-bottom: 1px dotted var(--SmartThemeQuoteColor);
width: 100%;
cursor: pointer;
}
#character_context_menu ul li button:hover {
background-color: var(--SmartThemeBlurTintColor);
}
#character_context_menu ul li:last-child button {
border-bottom: 0;
}
#character_context_menu ul li #character_context_menu_delete {
color: var(--fullred);
}
#character_context_menu ul {
list-style-type: none;
padding: 0;
margin: 0;
}
#character_context_menu .character_context_menu_separator {
height: 1px;
background-color: var(--SmartThemeBotMesBlurTintColor);
}
#character_context_menu li:hover {
background-color: var(--SmartThemeBotMesBlurTintColor);
}
#bulkEditButton.bulk_edit_overlay_active {
color: var(--golden);
}
#bulk_tag_shadow_popup {
backdrop-filter: blur(calc(var(--SmartThemeBlurStrength) * 2));
-webkit-backdrop-filter: blur(calc(var(--SmartThemeBlurStrength) * 2));
background-color: var(--black30a);
position: absolute;
width: 100%;
height: 100vh;
height: 100svh;
z-index: 9998;
top: 0;
}
#bulk_tag_shadow_popup #bulk_tag_popup {
padding: 1em;
}
#bulk_tag_shadow_popup #bulk_tag_popup #dialogue_popup_controls .menu_button {
width: 100px;
padding: 0.25em;
}

View File

@@ -3,11 +3,6 @@
display: block;
}
#extensions_status {
/* margin-bottom: 10px; */
font-weight: 700;
}
.extensions_block input[type="submit"]:hover {
background-color: green;
}
@@ -93,4 +88,119 @@ input.extension_missing[type="checkbox"] {
.update-button {
margin-right: 10px;
display: inline-flex;
}
}
/* Fixes order of settings for extensions */
#extensions_settings,
#extensions_settings2 {
display: flex;
flex-direction: column;
}
/** LEFT COLUMN **/
/* Must be always on top */
#extensions_settings>#assets_ui {
order: -1;
}
#extensions_settings>.expression_settings {
order: 2;
}
#extensions_settings>.background_settings {
order: 3;
}
#extensions_settings>.sd_settings {
order: 4;
}
#extensions_settings>#tts_settings {
order: 5;
}
#extensions_settings>#rvc_settings {
order: 6;
}
#extensions_settings>.objective-settings {
order: 7;
}
#extensions_settings>#speech_recognition_settings {
order: 8;
}
#extensions_settings>#audio_settings {
order: 9;
}
/** RIGHT COLUMN **/
#extensions_settings2>.translation_settings {
order: 1;
}
#extensions_settings2>.caption_settings {
order: 2;
}
#extensions_settings2>.quickReplySettings {
order: 3;
}
#extensions_settings2>.idle-settings {
order: 4;
}
#extensions_settings2>#memory_settings {
order: 5;
}
#extensions_settings2>.hypebot_settings {
order: 6;
}
#extensions_settings2>.regex_settings {
order: 7;
}
#extensions_settings2>.vectors_settings {
order: 8;
}
#extensions_settings2>.chromadb_settings {
order: 9;
}
#extensions_settings2>.randomizer_settings {
order: 10;
}
/** WAND MENU **/
#extensionsMenu>#ttsExtensionMenuItem {
order: 1;
}
#extensionsMenu>#sd_gen {
order: 2;
}
#extensionsMenu>#send_picture {
order: 3;
}
#extensionsMenu>#token_counter {
order: 4;
}
#extensionsMenu>#objective-task-manual-check-menu-item {
order: 5;
}
#extensionsMenu>#roll_dice {
order: 6;
}
#extensionsMenu>#translate_chat {
order: 7;
}

57
public/css/file-form.css Normal file
View File

@@ -0,0 +1,57 @@
.file_attached {
display: flex;
min-width: 150px;
max-width: calc(var(--sheldWidth) * 0.9);
flex-direction: row;
gap: 10px;
align-items: center;
margin: 0.25em auto;
padding: 0 0.75em;
border: 2px solid var(--SmartThemeBorderColor);
border-radius: 15px;
background-color: var(--white20a);
}
.mes_file_container {
cursor: default;
display: flex;
gap: 15px;
align-items: center;
width: fit-content;
max-width: 100%;
background-color: var(--white20a);
border: 2px solid var(--SmartThemeBorderColor);
padding: 0.5em 1em;
border-radius: 15px;
}
.mes_file_container .right_menu_button {
padding-right: 0;
}
.mes_file_container .mes_file_size,
.file_attached .file_size {
font-size: 0.9em;
color: var(--SmartThemeQuoteColor);
}
.file_attached .file_name,
.mes_file_container .mes_file_name {
flex: 1;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
#file_form {
display: flex;
width: 100%;
}
.file_modal {
width: 100%;
height: 100%;
overflow-y: auto;
display: flex;
text-align: left;
}

25
public/css/loader.css Normal file
View File

@@ -0,0 +1,25 @@
#loader {
position: fixed;
margin: 0;
padding: 0;
top: 0;
left: 0;
display: flex;
align-items: center;
justify-content: center;
z-index: 999999;
width: 100vw;
height: 100vh;
width: 100svw;
height: 100svh;
background-color: var(--SmartThemeBlurTintColor);
/*for some reason the full screen blur does not work on iOS*/
backdrop-filter: blur(30px);
color: var(--SmartThemeBodyColor);
opacity: 1;
}
#load-spinner {
transition: all 300ms ease-out;
opacity: 1;
}

View File

@@ -35,7 +35,7 @@
max-width: 90svw;
}
.world_entry_thin_controls,
/* .world_entry_thin_controls, */
#persona-management-block,
#character_popup .flex-container {
flex-direction: column;
@@ -63,6 +63,15 @@
display: none;
}
.world_entry .inline-drawer-toggle {
padding-bottom: 5px;
}
#worldInfoScanningCheckboxes {
flex-flow: row;
flex-wrap: wrap;
}
body {
touch-action: none;
overflow: hidden;
@@ -70,6 +79,10 @@
}
.world_entry_form_control {
/* width: 100%; */
}
.drawer-content {
min-width: unset;
width: 100%;
@@ -78,7 +91,7 @@
position: fixed;
left: 0;
top: 5px;
border: 1px solid var(--grey30);
border: 1px solid var(--SmartThemeBorderColor);
}
#select_chat_popup {
@@ -91,7 +104,6 @@
#top-settings-holder,
#top-bar {
position: fixed;
padding-top: 3px;
width: 100vw;
width: 100svw;
}
@@ -114,18 +126,32 @@
/* ,
#world_popup */
{
max-height: calc(100vh - 36px);
max-height: calc(100svh - 36px);
/*max-height: calc(100vh - 36px);
max-height: calc(100svh - 36px);*/
width: 100% !important;
margin: 0 auto;
max-width: 100%;
left: 0 !important;
resize: none !important;
top: 36px;
top: var(--topBarBlockSize);
}
.wi-settings {
flex-direction: column;
gap: 5px !important;
}
.WIEntryTitleAndStatus,
.WIEntryHeaderControls {
width: 100%;
}
#WIEntryHeaderTitlesPC {
display: none;
}
.WIEntryHeaderTitleMobile {
display: block !important;
}
#character_popup,
@@ -135,15 +161,15 @@
#character_popup,
#send_form {
border: 1px solid var(--grey30);
border: 1px solid var(--SmartThemeBorderColor);
backdrop-filter: blur(calc(var(--SmartThemeBlurStrength) * 2));
max-width: 100dvw;
}
#chat {
border-left: 1px solid var(--grey30);
border-right: 1px solid var(--grey30);
border-bottom: 1px solid var(--grey30);
border-left: 1px solid var(--SmartThemeBorderColor);
border-right: 1px solid var(--SmartThemeBorderColor);
border-bottom: 1px solid var(--SmartThemeBorderColor);
align-items: start;
align-content: start;
overflow-y: auto;
@@ -161,7 +187,9 @@
}
#showRawPrompt,
#groupCurrentMemberPopoutButton {
#copyPromptToClipboard,
#groupCurrentMemberPopoutButton,
#summaryExtensionPopoutButton {
display: none;
}
@@ -175,11 +203,11 @@
width: 100% !important;
max-width: 100% !important;
overflow-y: hidden;
border-left: 1px solid var(--grey30);
border-right: 1px solid var(--grey30);
border-bottom: 1px solid var(--grey30);
border-left: 1px solid var(--SmartThemeBorderColor);
border-right: 1px solid var(--SmartThemeBorderColor);
border-bottom: 1px solid var(--SmartThemeBorderColor);
border-radius: 0 0 20px 20px;
top: 36px !important;
top: var(--topBarBlockSize) !important;
left: 0 !important;
backdrop-filter: blur(calc(var(--SmartThemeBlurStrength) * 2));
}
@@ -265,12 +293,13 @@
display: none;
}
#bg_menu_content {
.bg_list {
width: unset;
}
}
@media screen and (min-width: 1001px) {
#PygOverrides,
#ContextFormatting,
#UI-Theme-Block,
@@ -310,8 +339,7 @@
min-width: 100px;
min-height: 100px;
max-height: 50vh;
max-width: 50vh;
width: 50vw;
max-width: 90vw;
position: absolute;
padding: 0;
filter: drop-shadow(2px 2px 2px #51515199);
@@ -341,6 +369,18 @@
top: unset;
bottom: unset;
}
#leftSendForm,
#rightSendForm {
width: 1.15em;
flex-wrap: wrap;
height: unset;
}
#extensionsMenuButton {
order: 1;
}
}
/*iOS specific*/
@@ -417,4 +457,4 @@
#horde_model {
height: unset;
}
}
}

View File

@@ -13,7 +13,7 @@
grid-column-end: 4;
width: 100%;
margin: 0.5em 0;
background-image: linear-gradient(90deg, var(--transparent), var(--white30a), var(--transparent));
background-image: linear-gradient(90deg, var(--transparent), var(--SmartThemeBorderColor), var(--transparent));
min-height: 1px;
}
@@ -54,7 +54,7 @@
#completion_prompt_manager #completion_prompt_manager_list li.completion_prompt_manager_prompt {
align-items: center;
padding: 0.5em;
border: 1px solid var(--white30a);
border: 1px solid var(--SmartThemeBorderColor);
}
#completion_prompt_manager #completion_prompt_manager_list li.completion_prompt_manager_prompt .prompt_manager_prompt_controls {
@@ -109,7 +109,7 @@
#completion_prompt_manager_popup .completion_prompt_manager_prompt {
margin: 1em 0;
padding: 0.5em;
border: 1px solid var(--white30a);
border: 1px solid var(--SmartThemeBorderColor);
}
#completion_prompt_manager_popup .completion_prompt_manager_popup_header {
@@ -265,7 +265,7 @@
top: var(--topBarBlockSize);
box-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
padding: 1em;
border: 1px solid #333333;
border: 1px solid var(--SmartThemeBorderColor);
flex-direction: column;
z-index: 3010 !important;
border-radius: 0 0 20px 20px;

View File

@@ -14,7 +14,8 @@
margin-top: auto;
margin-bottom: auto;
color: rgb(188, 193, 200, 1);
border: 1px solid #333;
border: 1px solid var(--SmartThemeBorderColor);
;
background-color: rgba(0, 0, 0, 0.3);
padding: 6px;
border-radius: 10px;
@@ -61,7 +62,8 @@
#rm_group_add_members {
margin-top: 0.25rem;
margin-bottom: 0.5rem;
border: 1px solid grey;
border: 1px solid var(--SmartThemeBorderColor);
;
border-radius: 10px;
background-color: var(--black30a);
}
@@ -76,6 +78,7 @@
#rm_group_members:empty {
width: 100%;
padding: 0.5em 0;
}
#rm_group_members:empty::before {
@@ -224,4 +227,5 @@
.group_member .avatar {
flex-shrink: 0;
}
flex-basis: auto;
}

View File

@@ -6,7 +6,7 @@
/* Customize the dropdown */
.select2-dropdown {
background-color: var(--SmartThemeBlurTintColor);
border: 1px solid var(--white30a) !important;
border: 1px solid var(--SmartThemeBorderColor) !important;
border-radius: 10px;
box-shadow: 0 0 5px black;
text-shadow: 0px 0px calc(var(--shadowWidth) * 1px) var(--SmartThemeShadowColor);
@@ -19,11 +19,24 @@
color: var(--SmartThemeBodyColor);
}
.select2-container .select2-search__field {
opacity: 0.8;
}
.select2-container .select2-selection--single .select2-selection__rendered {
color: var(--SmartThemeBodyColor);
line-height: revert;
padding-left: unset;
}
.select2-container .select2-results>.select2-results__options {
max-height: 300px;
}
.select2-container .select2-selection--multiple .select2-selection__choice__remove {
padding: revert;
border-right: 1px solid var(--white30a);
border-right: 1px solid var(--SmartThemeBorderColor);
font-size: 1.1em;
}
.select2-container .select2-selection--multiple .select2-selection__choice__display {
@@ -34,7 +47,7 @@
.select2-search__field {
background-color: var(--black30a);
color: var(--SmartThemeBodyColor);
border: 1px solid var(--white30a);
border: 1px solid var(--SmartThemeBorderColor);
border-radius: 7px;
font-family: "Noto Sans", "Noto Color Emoji", sans-serif;
padding: 3px 5px;
@@ -58,27 +71,30 @@
background-color: var(--SmartThemeBodyColor);
}
.select2-container .select2-selection--multiple {
.select2-container .select2-selection--multiple,
.select2-container .select2-selection--single {
background-color: var(--black30a);
color: var(--SmartThemeBodyColor);
border: 1px solid var(--white30a);
border: 1px solid var(--SmartThemeBorderColor);
border-radius: 7px;
font-family: "Noto Sans", "Noto Color Emoji", sans-serif;
padding: 3px 5px;
}
.select2-container.select2-container--focus .select2-selection--multiple {
border: 1px solid var(--white30a);
.select2-container.select2-container--focus .select2-selection--multiple,
.select2-container.select2-container--focus .select2-selection--single {
border: 1px solid var(--SmartThemeBorderColor);
}
.select2-container .select2-selection--multiple .select2-selection__choice {
.select2-container .select2-selection--multiple .select2-selection__choice,
.select2-container .select2-selection--single .select2-selection__choice {
border-radius: 5px;
border-style: solid;
border-width: 1px;
box-sizing: border-box;
color: var(--SmartThemeBodyColor);
background-color: var(--black30a);
border-color: var(--white30a);
border-color: var(--SmartThemeBorderColor);
font-size: calc(var(--mainFontSize) - 5%);
text-shadow: none !important;
}
@@ -114,12 +130,13 @@
margin-top: -7px;
width: 14px;
height: 14px;
border: 1px solid var(--white30a);
border: 1px solid var(--SmartThemeBorderColor);
background-color: var(--SmartThemeBlurTintColor);
border-radius: 2px;
}
.select2-container .select2-selection--multiple .select2-selection__choice__remove {
.select2-container .select2-selection--multiple .select2-selection__choice__remove,
.select2-container .select2-selection--single .select2-selection__choice__remove {
color: var(--SmartThemeBodyColor);
}

View File

@@ -6,6 +6,16 @@
color: var(--fullred);
}
.highlighted {
color: black;
background-color: yellow;
text-shadow: none !important;
}
.m-t-0 {
margin-top: 0;
}
.m-t-1 {
margin-top: 1em;
}
@@ -52,23 +62,24 @@
.margin-bot-10px,
.marginBot10 {
margin-bottom: 10px;
margin-bottom: 10px !important;
}
.marginTop10 {
margin-top: 10px;
margin-top: 10px !important;
}
.marginBot5 {
margin-bottom: 5px;
margin-bottom: 5px !important;
}
.marginTop5 {
margin-top: 5px;
margin-top: 5px !important;
}
.marginTopBot5 {
margin: 5px 0;
margin-top: 5px !important;
margin-bottom: 5px !important;
}
.margin5 {
@@ -95,10 +106,22 @@
align-items: flex-end !important;
}
.alignItemsBaseline {
align-items: baseline !important;
}
.alignSelfStart {
align-self: start;
}
.gap0 {
gap: 0 !important;
}
.gap3px {
gap: 3px !important;
}
.gap5px {
gap: 5px !important;
}
@@ -107,6 +130,14 @@
gap: 10px !important;
}
.gap10h20v {
gap: 10px 20px !important;
}
.gap10h5v {
gap: 5px 10px !important;
}
.wide10pMinFit {
width: 10%;
min-width: fit-content;
@@ -120,6 +151,10 @@
max-width: 100px;
}
.width100px {
width: 100px;
}
.widthUnset {
width: unset;
}
@@ -132,6 +167,10 @@
box-shadow: none !important;
}
.height100p {
height: 100%;
}
.height100pSpaceEvenly {
align-content: space-evenly;
height: 100%;
@@ -147,6 +186,10 @@
font-weight: 600;
}
.textAlignCenter {
text-align: center;
}
.margin-right-10px {
margin-right: 10px;
}
@@ -186,6 +229,26 @@
display: flex;
}
.flexBasis100p {
flex-basis: 100%;
}
.flexBasis50p {
flex-basis: 50%
}
.flexBasis25p {
flex-basis: 25%
}
.flexBasis200px {
flex-basis: 200px
}
.flexBasis48p {
flex-basis: 48%
}
.flex-container {
display: flex;
gap: 5px;
@@ -200,6 +263,14 @@
flex-grow: 1;
}
.flexShrink {
flex-shrink: 1
}
.flexWrap {
flex-wrap: wrap;
}
.flexnowrap {
flex-wrap: nowrap;
}
@@ -226,10 +297,18 @@
align-content: flex-start;
}
.alignContentCenter {
align-content: center;
}
.overflowHidden {
overflow: hidden;
}
.padding0 {
padding: 0;
}
.padding5 {
padding: 5px;
}
@@ -262,6 +341,10 @@
flex-flow: column;
}
.flexFlowRow {
flex-flow: row;
}
.wideMinContent {
width: min-content;
}
@@ -270,10 +353,6 @@
flex: 50%;
}
.wide50p {
width: 50% !important;
}
.wide25p {
width: 25%;
}
@@ -357,11 +436,20 @@
display: none;
}
.hoverglow {
transition: opacity 200ms;
}
.hoverglow:hover {
opacity: 1 !important;
cursor: pointer;
}
input:disabled,
textarea:disabled {
cursor: not-allowed;
}
.debug-red {
border: 1px solid red !important;
}
@@ -382,6 +470,10 @@
border: 1px solid purple !important;
}
.fontsize120p {
font-size: calc(var(--mainFontSize) * 1.2) !important;
}
.fontsize80p {
font-size: calc(var(--mainFontSize) * 0.8) !important;
}
@@ -390,6 +482,11 @@
font-size: calc(var(--mainFontSize) * 0.6) !important;
}
.paddingBottom5px {
padding: unset;
padding-bottom: 5px;
}
.paddingTopBot5 {
padding: 5px 0;
}
@@ -415,6 +512,22 @@
gap: 10px;
}
.opacity50p {
opacity: 0.5
}
.opacity1 {
opacity: 1 !important;
}
.circleborder30px {
right: 30px;
top: 10px;
position: absolute;
border: 1px solid var(--SmartThemeBodyColor);
border-radius: 100%;
aspect-ratio: 1 / 1;
height: 30px;
text-align: center;
padding: 5px;
}

View File

@@ -1,3 +1,4 @@
#bulk_tags_div,
#tags_div {
min-width: 0;
}
@@ -12,7 +13,7 @@
.tag_view_item {
display: flex;
flex-direction: row;
align-items: baseline;
align-items: center;
gap: 10px;
margin-bottom: 5px;
}
@@ -86,10 +87,12 @@
align-items: flex-end;
}
#bulkTagsList,
#tagList.tags {
margin: 5px 0;
}
#bulkTagsList,
#tagList .tag {
opacity: 0.6;
}
@@ -109,6 +112,7 @@
overflow: hidden;
text-align: left;
white-space: nowrap;
text-shadow: none !important;
}
.tags_inline .tag {
@@ -128,10 +132,16 @@
cursor: pointer;
opacity: 0.6;
filter: brightness(0.8);
transition: opacity 200ms;
}
.tags_view,
.open_alternate_greetings {
.rm_tag_filter .tag:hover {
opacity: 1;
filter: brightness(1);
}
.tags_view {
margin: 0;
aspect-ratio: 1 / 1;
}

View File

@@ -17,6 +17,13 @@ body.no-modelIcons .icon-svg {
display: none !important;
}
body.square-avatars .avatar,
body.square-avatars .avatar img,
body.square-avatars .hotswapAvatar,
body.square-avatars .hotswapAvatar img {
border-radius: 2px !important;
}
/*char list grid mode*/
body.charListGrid #rm_print_characters_block {
@@ -28,6 +35,7 @@ body.charListGrid #rm_print_characters_block {
align-content: flex-start;
}
body.charListGrid #rm_print_characters_block .bogus_folder_select,
body.charListGrid #rm_print_characters_block .character_select {
width: 30%;
align-items: flex-start;
@@ -37,6 +45,7 @@ body.charListGrid #rm_print_characters_block .character_select {
max-width: 100px;
}
body.charListGrid #rm_print_characters_block .bogus_folder_select .ch_name,
body.charListGrid #rm_print_characters_block .character_select .ch_name,
body.charListGrid #rm_print_characters_block .group_select .ch_name {
width: 100%;
@@ -45,10 +54,12 @@ body.charListGrid #rm_print_characters_block .group_select .ch_name {
font-size: calc(var(--mainFontSize) * .8);
}
body.charListGrid #rm_print_characters_block .bogus_folder_select .character_name_block,
body.charListGrid #rm_print_characters_block .character_select .character_name_block {
width: 100%;
}
body.charListGrid #rm_print_characters_block .bogus_folder_select .character_select_container,
body.charListGrid #rm_print_characters_block .character_select .character_select_container {
width: 100%;
justify-content: center;
@@ -68,6 +79,7 @@ body.charListGrid #rm_print_characters_block .group_select .group_name_block {
width: 100%;
}
body.charListGrid #rm_print_characters_block .bogus_folder_counter_block,
body.charListGrid #rm_print_characters_block .ch_description,
body.charListGrid #rm_print_characters_block .tags_inline,
body.charListGrid #rm_print_characters_block .character_version,
@@ -117,7 +129,7 @@ body.big-avatars .avatar img {
height: 90px;
object-fit: cover;
object-position: center;
border: 1px solid var(--black30a);
border: 1px solid var(--SmartThemeBorderColor);
border-radius: 10px;
}
@@ -191,7 +203,7 @@ body.bubblechat .mes {
border-radius: 10px;
background-color: var(--SmartThemeBotMesBlurTintColor);
margin-bottom: 5px;
border: 1px solid var(--white30a);
border: 1px solid var(--SmartThemeBorderColor);
}
body.bubblechat .mes[is_user="true"] {
@@ -257,31 +269,16 @@ body.no-blur #bg_custom {
}
body:not(.bubblechat).no-blur #chat,
body.no-blur #top-bar,
body.no-blur #send_form {
background-color: var(--SmartThemeBlurTintColor) !important;
}
body.no-blur #options,
body.no-blur .ui-widget-content,
body.no-blur #floatingPrompt,
body.no-blur #extensionsMenu,
body.no-blur .list-group,
body.no-blur #character_popup,
body.no-blur #world_popup,
body.no-blur #dialogue_popup,
body.no-blur #select_chat_popup,
body.no-blur .drawer-content,
body.no-blur .select2-results__options {
background-color: black !important;
}
/* wAIfu mode*/
body.waifuMode #top-bar {
border-radius: 0 0 20px 20px;
border: 1px solid var(--grey30a);
border: 1px solid var(--SmartThemeBorderColor);
}
body.waifuMode #sheld {
@@ -292,7 +289,7 @@ body.waifuMode #sheld {
}
body.waifuMode #chat {
border-top: 1px solid var(--grey30a);
border-top: 1px solid var(--SmartThemeBorderColor);
border-radius: 20px 20px 0 0;
}
@@ -343,8 +340,7 @@ body.movingUI .drawer-content,
body.movingUI #expression-holder,
body.movingUI .zoomed_avatar,
body.movingUI .draggable,
body.movingUI #floatingPrompt,
body.movingUI #groupMemberListPopout {
body.movingUI #floatingPrompt {
resize: both;
}
@@ -353,6 +349,7 @@ body.movingUI #groupMemberListPopout {
height: 120px;
margin-top: 0;
top: 50px;
justify-content: center;
}
/*No Text Shadows Mode*/
@@ -360,3 +357,19 @@ body.movingUI #groupMemberListPopout {
body.noShadows * {
text-shadow: none !important;
}
body.expandMessageActions .mes .mes_buttons .extraMesButtons {
display: inherit !important;
}
body.expandMessageActions .mes .mes_buttons .extraMesButtonsHint {
display: none !important;
}
#openai_image_inlining:not(:checked)~#image_inlining_hint {
display: none;
}
#openai_image_inlining:checked~#image_inlining_hint {
display: block;
}

View File

@@ -101,7 +101,7 @@
height: auto;
margin-top: 0;
margin-bottom: 0;
min-height: 32px;
min-height: calc(var(--mainFontSize) + 13px);
}
.delete_entry_button {
@@ -157,6 +157,37 @@
width: 10em;
}
#world_info_search {
width: 10em;
#world_info_search,
#world_info_sort_order {
width: 7em;
}
.wi-card-entry {
border: 1px solid;
border-color: var(--SmartThemeBorderColor);
border-radius: 10px;
padding: 0 5px;
margin-bottom: 1px;
}
.world_entry {
transition: opacity 500ms;
}
.disabledWIEntry {
opacity: 0.4;
filter: grayscale(1);
}
.disabledWIEntry:not(input):hover {
opacity: 1;
filter: grayscale(0.5);
}
.height32px {
height: 32px;
}
.WIEntryHeaderTitleMobile {
display: none;
}

File diff suppressed because it is too large Load Diff

71
public/img/aphrodite.svg Normal file
View File

@@ -0,0 +1,71 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
viewBox="0 0 500 500"
version="1.1"
id="svg6"
sodipodi:docname="aphrodite.svg"
inkscape:version="1.3 (0e150ed, 2023-07-21)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs6" />
<sodipodi:namedview
id="namedview6"
pagecolor="#ffffff"
bordercolor="#000000"
borderopacity="0.25"
inkscape:showpageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
inkscape:zoom="0.472"
inkscape:cx="251.05932"
inkscape:cy="250"
inkscape:window-width="1280"
inkscape:window-height="449"
inkscape:window-x="0"
inkscape:window-y="25"
inkscape:window-maximized="0"
inkscape:current-layer="svg6" />
<g
transform="matrix(1.3637143,0,0,1.2306337,286.98714,309.0439)"
id="b08450db-4034-4e8d-9232-9d086fc10fd0" />
<g
transform="matrix(1.3637143,0,0,1.2306337,286.98714,309.0439)"
id="54daa6c1-4b17-4e19-b0bb-42d1bcbfe659" />
<g
transform="matrix(1.3637143,0,0,1.2306337,186.0314,431.30731)"
id="g2" />
<g
transform="matrix(1.3637143,0,0,1.2306337,288.29633,320.27957)"
id="g3" />
<g
transform="matrix(1.686936,0,0,1.507445,388.05263,106.65182)"
id="g6"
style="">
<g
id="g5"
style="">
<path
style="opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;"
vector-effect="non-scaling-stroke"
d="m -189.927,161.041 32.809,-32.022 47.368,38.876 -32.619,43.738 -87.665,49.304 z"
stroke-linecap="round"
id="path3" />
<path
style="opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;"
vector-effect="non-scaling-stroke"
d="m -64.913,42.392 32.651,28.068 -77.49,97.438 -47.367,-38.878 91.346,-87.359 z"
stroke-linecap="round"
id="path4" />
<path
style="opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;"
vector-effect="non-scaling-stroke"
d="m 46.895,-67.722 -2.202,2.004 -110.467,107.379 33.512,28.799 95.769,-121.944 0.023,-0.025 c 2.011,-2.328 2.952,-5.03 2.819,-8.105 -0.131,-3.074 -1.3,-5.686 -3.502,-7.834 -2.205,-2.148 -4.846,-3.248 -7.922,-3.3 -3.077,-0.054 -5.754,0.955 -8.03,3.026 z"
stroke-linecap="round"
id="path5" />
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.8 KiB

3
public/img/mancer.svg Normal file
View File

@@ -0,0 +1,3 @@
<svg width="128" height="128" viewBox="0 0 128 128" style="enable-background:new 0 0 128 128;" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<path d="M115.36,61.84L70.22,50.49L114.45,2.4c0.41-0.45,0.43-1.13,0.05-1.6c-0.39-0.48-1.07-0.59-1.59-0.27 L12.3,61.98c-0.41,0.25-0.64,0.72-0.57,1.2c0.06,0.48,0.4,0.87,0.87,1.01l45.07,13.25L13.38,125.6c-0.42,0.46-0.44,1.15-0.04,1.61 c0.24,0.29,0.58,0.44,0.94,0.44c0.22,0,0.45-0.06,0.65-0.19l100.78-63.41c0.42-0.26,0.64-0.75,0.56-1.22 C116.19,62.34,115.84,61.95,115.36,61.84z" />
</svg>

After

Width:  |  Height:  |  Size: 561 B

View File

@@ -1,3 +1,3 @@
<svg width="33" height="41" viewBox="0 0 33 41" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M5.89418 31.9285C4.51814 29.6818 2.83212 27.8112 0.836131 26.521C0.26793 26.1537 0.124452 25.3382 0.540438 24.8047C4.15593 20.1672 9.79294 8.01868 12.7415 1.40215C13.181 0.416062 14.6883 0.738582 14.6883 1.81816V19.44C13.1242 20.1331 12.0332 21.6992 12.0332 23.5201C12.0332 24.1851 12.1787 24.8161 12.4397 25.383L5.89418 31.9285ZM7.34675 34.6814C8.03773 36.2042 8.61427 37.8368 9.07635 39.5334C9.19588 39.9722 9.59101 40.2824 10.0459 40.2824H16.4937H22.9416C23.3964 40.2824 23.7916 39.9722 23.9111 39.5334C24.3732 37.8368 24.9497 36.2042 25.6407 34.6814L22.211 31.2516L19.3551 34.1075C19.4281 34.3655 19.4672 34.6378 19.4672 34.9192C19.4672 36.5615 18.1358 37.8928 16.4935 37.8928C14.8512 37.8928 13.5198 36.5615 13.5198 34.9192C13.5198 33.2768 14.8512 31.9455 16.4935 31.9455C16.7448 31.9455 16.9888 31.9766 17.2219 32.0353L20.1083 29.1489L18.4762 27.5169C17.879 27.8137 17.2058 27.9806 16.4937 27.9806C15.7816 27.9806 15.1084 27.8137 14.5112 27.5169L7.34675 34.6814ZM27.0933 31.9285C28.4693 29.6818 30.1553 27.8112 32.1513 26.521C32.7195 26.1537 32.863 25.3382 32.447 24.8047C28.8315 20.1672 23.1945 8.01868 20.2459 1.40215C19.8065 0.416062 18.2992 0.738582 18.2992 1.81816V19.44C19.8632 20.1332 20.9542 21.6992 20.9542 23.5201C20.9542 24.1851 20.8087 24.8161 20.5478 25.383L27.0933 31.9285Z" fill="white"/>
<svg width="33" height="41" viewBox="0 0 33 41" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M5.89418 31.9285C4.51814 29.6818 2.83212 27.8112 0.836131 26.521C0.26793 26.1537 0.124452 25.3382 0.540438 24.8047C4.15593 20.1672 9.79294 8.01868 12.7415 1.40215C13.181 0.416062 14.6883 0.738582 14.6883 1.81816V19.44C13.1242 20.1331 12.0332 21.6992 12.0332 23.5201C12.0332 24.1851 12.1787 24.8161 12.4397 25.383L5.89418 31.9285ZM7.34675 34.6814C8.03773 36.2042 8.61427 37.8368 9.07635 39.5334C9.19588 39.9722 9.59101 40.2824 10.0459 40.2824H16.4937H22.9416C23.3964 40.2824 23.7916 39.9722 23.9111 39.5334C24.3732 37.8368 24.9497 36.2042 25.6407 34.6814L22.211 31.2516L19.3551 34.1075C19.4281 34.3655 19.4672 34.6378 19.4672 34.9192C19.4672 36.5615 18.1358 37.8928 16.4935 37.8928C14.8512 37.8928 13.5198 36.5615 13.5198 34.9192C13.5198 33.2768 14.8512 31.9455 16.4935 31.9455C16.7448 31.9455 16.9888 31.9766 17.2219 32.0353L20.1083 29.1489L18.4762 27.5169C17.879 27.8137 17.2058 27.9806 16.4937 27.9806C15.7816 27.9806 15.1084 27.8137 14.5112 27.5169L7.34675 34.6814ZM27.0933 31.9285C28.4693 29.6818 30.1553 27.8112 32.1513 26.521C32.7195 26.1537 32.863 25.3382 32.447 24.8047C28.8315 20.1672 23.1945 8.01868 20.2459 1.40215C19.8065 0.416062 18.2992 0.738582 18.2992 1.81816V19.44C19.8632 20.1332 20.9542 21.6992 20.9542 23.5201C20.9542 24.1851 20.8087 24.8161 20.5478 25.383L27.0933 31.9285Z" />
</svg>

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

67
public/img/palm.svg Normal file
View File

@@ -0,0 +1,67 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 27.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Standard_product_icon__x28_1:1_x29_"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="192px" height="192px" viewBox="0 0 192 192" enable-background="new 0 0 192 192" xml:space="preserve">
<symbol id="material_x5F_product_x5F_standard_x5F_icon_x5F_keylines_00000077318920148093339210000006245950728745084294_" viewBox="-96 -96 192 192">
<g opacity="0.4">
<defs>
<path id="SVGID_1_" opacity="0.4" d="M-96,96V-96H96V96H-96z"/>
</defs>
<clipPath id="SVGID_00000071517564283228984050000017848131202901217410_">
<use xlink:href="#SVGID_1_" overflow="visible"/>
</clipPath>
<g clip-path="url(#SVGID_00000071517564283228984050000017848131202901217410_)">
<g>
<path d="M95.75,95.75v-191.5h-191.5v191.5H95.75 M96,96H-96V-96H96V96L96,96z"/>
</g>
<circle fill="none" stroke="#000000" stroke-width="0.25" stroke-miterlimit="10" cx="0" cy="0" r="64"/>
</g>
<circle clip-path="url(#SVGID_00000071517564283228984050000017848131202901217410_)" fill="none" stroke="#000000" stroke-width="0.25" stroke-miterlimit="10" cx="0" cy="0" r="88"/>
<path clip-path="url(#SVGID_00000071517564283228984050000017848131202901217410_)" fill="none" stroke="#000000" stroke-width="0.25" stroke-miterlimit="10" d="
M64,76H-64c-6.6,0-12-5.4-12-12V-64c0-6.6,5.4-12,12-12H64c6.6,0,12,5.4,12,12V64C76,70.6,70.6,76,64,76z"/>
<path clip-path="url(#SVGID_00000071517564283228984050000017848131202901217410_)" fill="none" stroke="#000000" stroke-width="0.25" stroke-miterlimit="10" d="
M52,88H-52c-6.6,0-12-5.4-12-12V-76c0-6.6,5.4-12,12-12H52c6.6,0,12,5.4,12,12V76C64,82.6,58.6,88,52,88z"/>
<path clip-path="url(#SVGID_00000071517564283228984050000017848131202901217410_)" fill="none" stroke="#000000" stroke-width="0.25" stroke-miterlimit="10" d="
M76,64H-76c-6.6,0-12-5.4-12-12V-52c0-6.6,5.4-12,12-12H76c6.6,0,12,5.4,12,12V52C88,58.6,82.6,64,76,64z"/>
</g>
</symbol>
<rect id="bounding_box_1_" display="none" fill="none" width="192" height="192"/>
<g id="art_layer">
<g>
<path d="M96,181.92L96,181.92c6.63,0,12-5.37,12-12v-104H84v104C84,176.55,89.37,181.92,96,181.92z"/>
<g>
<path d="M143.81,103.87C130.87,90.94,111.54,88.32,96,96l51.37,51.37c2.12,2.12,5.77,1.28,6.67-1.57
C158.56,131.49,155.15,115.22,143.81,103.87z"/>
</g>
<g>
<path d="M48.19,103.87C61.13,90.94,80.46,88.32,96,96l-51.37,51.37c-2.12,2.12-5.77,1.28-6.67-1.57
C33.44,131.49,36.85,115.22,48.19,103.87z"/>
</g>
<g>
<path d="M140,64c-20.44,0-37.79,13.4-44,32h81.24c3.33,0,5.55-3.52,4.04-6.49C173.56,74.36,157.98,64,140,64z"/>
</g>
<g>
<path d="M104.49,42.26C90.03,56.72,87.24,78.45,96,96l57.45-57.45c2.36-2.36,1.44-6.42-1.73-7.45
C135.54,25.85,117.2,29.55,104.49,42.26z"/>
</g>
<g>
<path d="M87.51,42.26C101.97,56.72,104.76,78.45,96,96L38.55,38.55c-2.36-2.36-1.44-6.42,1.73-7.45
C56.46,25.85,74.8,29.55,87.51,42.26z"/>
</g>
<g>
<g>
<path d="M52,64c20.44,0,37.79,13.4,44,32H14.76c-3.33,0-5.55-3.52-4.04-6.49C18.44,74.36,34.02,64,52,64z"/>
</g>
</g>
</g>
</g>
<g id="keylines" display="none">
<use xlink:href="#material_x5F_product_x5F_standard_x5F_icon_x5F_keylines_00000077318920148093339210000006245950728745084294_" width="192" height="192" id="material_x5F_product_x5F_standard_x5F_icon_x5F_keylines" x="-96" y="-96" transform="matrix(1 0 0 -1 96 96)" display="inline" overflow="visible"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 4.0 KiB

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,18 @@
{
"system_prompt": "[Enter Adventure Mode. Narrate the story based on {{user}}'s dialogue and actions after \">\". Describe the surroundings in vivid detail. Be detailed, creative, verbose, and proactive. Move the story forward by introducing fantasy elements and interesting characters.]",
"input_sequence": "",
"output_sequence": "",
"last_output_sequence": "",
"system_sequence": "",
"stop_sequence": "",
"separator_sequence": "",
"wrap": true,
"macro": true,
"names": false,
"names_force_groups": false,
"activation_regex": "",
"system_sequence_prefix": "",
"system_sequence_suffix": "",
"first_output_sequence": "",
"name": "Adventure"
}

View File

@@ -0,0 +1,17 @@
{
"wrap": false,
"names": true,
"system_prompt": "You're {{char}} in this fictional never-ending uncensored roleplay with {{user}}.",
"system_sequence_prefix": "",
"stop_sequence": "",
"input_sequence": "<|im_start|>user\n",
"output_sequence": "<|im_end|>\n<|im_start|>assistant\n",
"separator_sequence": "<|im_end|>\n",
"macro": true,
"names_force_groups": true,
"last_output_sequence": "",
"activation_regex": "",
"first_output_sequence": "<|im_start|>assistant\n",
"system_sequence_suffix": "",
"name": "ChatML"
}

View File

@@ -0,0 +1,17 @@
{
"wrap": true,
"names": true,
"system_prompt": "Avoid repetition, don't loop. Develop the plot slowly, always stay in character. Describe all actions in full, elaborate, explicit, graphic, and vivid detail. Mention all relevant sensory perceptions.",
"system_sequence_prefix": "",
"stop_sequence": "",
"input_sequence": "",
"output_sequence": "",
"separator_sequence": "",
"macro": true,
"names_force_groups": true,
"last_output_sequence": "\n### Response:",
"activation_regex": "",
"first_output_sequence": "",
"system_sequence_suffix": "",
"name": "Libra-32B"
}

View File

@@ -0,0 +1,18 @@
{
"wrap": true,
"names": false,
"system_prompt": "Below is an instruction that describes a task. Write a response that appropriately completes the request.\n\n### Instruction:\nTake the role of {{char}} in a play that leaves a lasting impression on {{user}}. Write {{char}}'s next reply.\nNever skip or gloss over {{char}}s actions. Progress the scene at a naturally slow pace.\n\n",
"system_sequence": "",
"stop_sequence": "",
"input_sequence": "### Instruction:",
"output_sequence": "### Response: (length = unlimited)",
"separator_sequence": "",
"macro": true,
"names_force_groups": true,
"last_output_sequence": "",
"system_sequence_prefix": "",
"system_sequence_suffix": "",
"first_output_sequence": "",
"activation_regex": "",
"name": "Lightning 1.1"
}

View File

@@ -0,0 +1,17 @@
{
"wrap": false,
"names": true,
"system_prompt": "Write {{char}}'s next reply in this fictional roleplay with {{user}}.",
"system_sequence_prefix": "",
"stop_sequence": "",
"input_sequence": "[INST] ",
"output_sequence": " [/INST]\n",
"separator_sequence": "\n",
"macro": true,
"names_force_groups": true,
"last_output_sequence": "",
"activation_regex": "",
"first_output_sequence": "\n",
"system_sequence_suffix": "",
"name": "Mistral"
}

View File

@@ -0,0 +1,17 @@
{
"name": "Pygmalion",
"system_prompt": "Enter RP mode. You shall reply to {{user}} while staying in character. Your responses must be detailed, creative, immersive, and drive the scenario forward. You will follow {{char}}'s persona.",
"input_sequence": "<|user|>",
"output_sequence": "<|model|>",
"first_output_sequence": "",
"last_output_sequence": "",
"system_sequence_prefix": "<|system|>",
"system_sequence_suffix": "",
"stop_sequence": "<|user|>",
"separator_sequence": "",
"wrap": false,
"macro": true,
"names": true,
"names_force_groups": true,
"activation_regex": ""
}

View File

@@ -0,0 +1,18 @@
{
"system_prompt": "",
"input_sequence": "",
"output_sequence": "",
"last_output_sequence": "",
"system_sequence": "",
"stop_sequence": "",
"separator_sequence": "",
"wrap": true,
"macro": true,
"names": false,
"names_force_groups": false,
"activation_regex": "",
"system_sequence_prefix": "",
"system_sequence_suffix": "",
"first_output_sequence": "",
"name": "Story"
}

View File

@@ -0,0 +1,17 @@
{
"wrap": false,
"names": false,
"system_prompt": "Elaborate on the topic using a Tree of Thoughts and backtrack when necessary to construct a clear, cohesive Chain of Thought reasoning. Always answer without hesitation.",
"system_sequence_prefix": "SYSTEM: ",
"stop_sequence": "",
"input_sequence": "USER: ",
"output_sequence": "\nASSISTANT: ",
"separator_sequence": "\n",
"macro": true,
"names_force_groups": true,
"last_output_sequence": "",
"activation_regex": "",
"first_output_sequence": "ASSISTANT: ",
"system_sequence_suffix": "",
"name": "Synthia"
}

View File

@@ -0,0 +1,25 @@
(function($) {
var Defaults = $.fn.select2.amd.require('select2/defaults');
$.extend(Defaults.defaults, {
searchInputPlaceholder: '',
searchInputCssClass: '',
});
var SearchDropdown = $.fn.select2.amd.require('select2/dropdown/search');
var _renderSearchDropdown = SearchDropdown.prototype.render;
SearchDropdown.prototype.render = function(decorated) {
// invoke parent method
var $rendered = _renderSearchDropdown.apply(this, Array.prototype.slice.apply(arguments));
this.$search.attr('placeholder', this.options.get('searchInputPlaceholder'));
this.$search.addClass(this.options.get('searchInputCssClass'));
return $rendered;
};
})(window.jQuery);

30
public/manifest.json Normal file
View File

@@ -0,0 +1,30 @@
{
"name": "SillyTavern",
"short_name": "SillyTavern",
"start_url": "/",
"display": "standalone",
"theme_color": "#202124",
"background_color": "#202124",
"icons": [
{
"src": "img/apple-icon-57x57.png",
"sizes": "57x57",
"type": "image/png"
},
{
"src": "img/apple-icon-72x72.png",
"sizes": "72x72",
"type": "image/png"
},
{
"src": "img/apple-icon-114x114.png",
"sizes": "114x114",
"type": "image/png"
},
{
"src": "img/apple-icon-144x144.png",
"sizes": "144x144",
"type": "image/png"
}
]
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,652 @@
"use strict";
import {
callPopup,
characters,
deleteCharacter,
event_types,
eventSource,
getCharacters,
getRequestHeaders,
printCharacters,
this_chid
} from "../script.js";
import { favsToHotswap } from "./RossAscends-mods.js";
import { hideLoader, showLoader } from "./loader.js";
import { convertCharacterToPersona } from "./personas.js";
import { createTagInput, getTagKeyForCharacter, tag_map } from "./tags.js";
// Utility object for popup messages.
const popupMessage = {
deleteChat(characterCount) {
return `<h3>Delete ${characterCount} characters?</h3>
<b>THIS IS PERMANENT!<br><br>
<label for="del_char_checkbox" class="checkbox_label justifyCenter">
<input type="checkbox" id="del_char_checkbox" />
<span>Also delete the chat files</span>
</label><br></b>`;
},
}
/**
* Static object representing the actions of the
* character context menu override.
*/
class CharacterContextMenu {
/**
* Tag one or more characters,
* opens a popup.
*
* @param selectedCharacters
*/
static tag = (selectedCharacters) => {
BulkTagPopupHandler.show(selectedCharacters);
}
/**
* Duplicate one or more characters
*
* @param characterId
* @returns {Promise<Response>}
*/
static duplicate = async (characterId) => {
const character = CharacterContextMenu.#getCharacter(characterId);
return fetch('/dupecharacter', {
method: 'POST',
headers: getRequestHeaders(),
body: JSON.stringify({ avatar_url: character.avatar }),
});
}
/**
* Favorite a character
* and highlight it.
*
* @param characterId
* @returns {Promise<void>}
*/
static favorite = async (characterId) => {
const character = CharacterContextMenu.#getCharacter(characterId);
// Only set fav for V2 spec
const data = {
name: character.name,
avatar: character.avatar,
data: {
extensions: {
fav: !character.data.extensions.fav
}
}
};
return fetch('/v2/editcharacterattribute', {
method: "POST",
headers: getRequestHeaders(),
body: JSON.stringify(data),
}).then((response) => {
if (response.ok) {
const element = document.getElementById(`CharID${characterId}`);
element.classList.toggle('is_fav');
} else {
response.json().then(json => toastr.error('Character not saved. Error: ' + json.message + '. Field: ' + json.error));
}
});
}
/**
* Convert one or more characters to persona,
* may open a popup for one or more characters.
*
* @param characterId
* @returns {Promise<void>}
*/
static persona = async (characterId) => await convertCharacterToPersona(characterId);
/**
* Delete one or more characters,
* opens a popup.
*
* @param characterId
* @param deleteChats
* @returns {Promise<void>}
*/
static delete = async (characterId, deleteChats = false) => {
const character = CharacterContextMenu.#getCharacter(characterId);
return fetch('/deletecharacter', {
method: 'POST',
headers: getRequestHeaders(),
body: JSON.stringify({ avatar_url: character.avatar, delete_chats: deleteChats }),
cache: 'no-cache',
}).then(response => {
if (response.ok) {
deleteCharacter(character.name, character.avatar).then(() => {
if (deleteChats) {
fetch("/getallchatsofcharacter", {
method: 'POST',
body: JSON.stringify({ avatar_url: character.avatar }),
headers: getRequestHeaders(),
}).then((response) => {
let data = response.json();
data = Object.values(data);
const pastChats = data.sort((a, b) => a["file_name"].localeCompare(b["file_name"])).reverse();
for (const chat of pastChats) {
const name = chat.file_name.replace('.jsonl', '');
eventSource.emit(event_types.CHAT_DELETED, name);
}
});
}
})
}
eventSource.emit('characterDeleted', { id: this_chid, character: characters[this_chid] });
});
}
static #getCharacter = (characterId) => characters[characterId] ?? null;
/**
* Show the context menu at the given position
*
* @param positionX
* @param positionY
*/
static show = (positionX, positionY) => {
let contextMenu = document.getElementById(BulkEditOverlay.contextMenuId);
contextMenu.style.left = `${positionX}px`;
contextMenu.style.top = `${positionY}px`;
document.getElementById(BulkEditOverlay.contextMenuId).classList.remove('hidden');
// Adjust position if context menu is outside of viewport
const boundingRect = contextMenu.getBoundingClientRect();
if (boundingRect.right > window.innerWidth) {
contextMenu.style.left = `${positionX - (boundingRect.right - window.innerWidth)}px`;
}
if (boundingRect.bottom > window.innerHeight) {
contextMenu.style.top = `${positionY - (boundingRect.bottom - window.innerHeight)}px`;
}
}
/**
* Hide the context menu
*/
static hide = () => document.getElementById(BulkEditOverlay.contextMenuId).classList.add('hidden');
/**
* Sets up the context menu for the given overlay
*
* @param characterGroupOverlay
*/
constructor(characterGroupOverlay) {
const contextMenuItems = [
{ id: 'character_context_menu_favorite', callback: characterGroupOverlay.handleContextMenuFavorite },
{ id: 'character_context_menu_duplicate', callback: characterGroupOverlay.handleContextMenuDuplicate },
{ id: 'character_context_menu_delete', callback: characterGroupOverlay.handleContextMenuDelete },
{ id: 'character_context_menu_persona', callback: characterGroupOverlay.handleContextMenuPersona },
{ id: 'character_context_menu_tag', callback: characterGroupOverlay.handleContextMenuTag }
];
contextMenuItems.forEach(contextMenuItem => document.getElementById(contextMenuItem.id).addEventListener('click', contextMenuItem.callback))
}
}
/**
* Represents a tag control not bound to a single character
*/
class BulkTagPopupHandler {
static #getHtml = (characterIds) => {
const characterData = JSON.stringify({ characterIds: characterIds });
return `<div id="bulk_tag_shadow_popup">
<div id="bulk_tag_popup">
<div id="bulk_tag_popup_holder">
<h3 class="m-b-1">Add tags to ${characterIds.length} characters</h3>
<br>
<div id="bulk_tags_div" class="marginBot5" data-characters='${characterData}'>
<div class="tag_controls">
<input id="bulkTagInput" class="text_pole tag_input wide100p margin0" data-i18n="[placeholder]Search / Create Tags" placeholder="Search / Create tags" maxlength="25" />
<div class="tags_view menu_button fa-solid fa-tags" title="View all tags" data-i18n="[title]View all tags"></div>
</div>
<div id="bulkTagList" class="m-t-1 tags"></div>
</div>
<div id="dialogue_popup_controls" class="m-t-1">
<div id="bulk_tag_popup_cancel" class="menu_button" data-i18n="Cancel">Close</div>
<div id="bulk_tag_popup_reset" class="menu_button" data-i18n="Cancel">Remove all</div>
</div>
</div>
</div>
</div>
`
};
/**
* Append and show the tag control
*
* @param characters - The characters assigned to this control
*/
static show(characters) {
document.body.insertAdjacentHTML('beforeend', this.#getHtml(characters));
createTagInput('#bulkTagInput', '#bulkTagList');
document.querySelector('#bulk_tag_popup_cancel').addEventListener('click', this.hide.bind(this));
document.querySelector('#bulk_tag_popup_reset').addEventListener('click', this.resetTags.bind(this, characters));
}
/**
* Hide and remove the tag control
*/
static hide() {
let popupElement = document.querySelector('#bulk_tag_shadow_popup');
if (popupElement) {
document.body.removeChild(popupElement);
}
printCharacters(true);
}
/**
* Empty the tag map for the given characters
*
* @param characterIds
*/
static resetTags(characterIds) {
characterIds.forEach((characterId) => {
const key = getTagKeyForCharacter(characterId);
if (key) tag_map[key] = [];
});
printCharacters(true);
}
}
class BulkEditOverlayState {
/**
*
* @type {number}
*/
static browse = 0;
/**
*
* @type {number}
*/
static select = 1;
}
/**
* Implement a SingletonPattern, allowing access to the group overlay instance
* from everywhere via (new CharacterGroupOverlay())
*
* @type BulkEditOverlay
*/
let bulkEditOverlayInstance = null;
class BulkEditOverlay {
static containerId = 'rm_print_characters_block';
static contextMenuId = 'character_context_menu';
static characterClass = 'character_select';
static groupClass = 'group_select';
static bogusFolderClass = 'bogus_folder_select';
static selectModeClass = 'group_overlay_mode_select';
static selectedClass = 'character_selected';
static legacySelectedClass = 'bulk_select_checkbox';
static longPressDelay = 2500;
#state = BulkEditOverlayState.browse;
#longPress = false;
#stateChangeCallbacks = [];
#selectedCharacters = [];
/**
* Locks other pointer actions when the context menu is open
*
* @type {boolean}
*/
#contextMenuOpen = false;
/**
* Whether the next character select should be skipped
*
* @type {boolean}
*/
#cancelNextToggle = false;
/**
* @type HTMLElement
*/
container = null;
get state() {
return this.#state;
}
set state(newState) {
if (this.#state === newState) return;
eventSource.emit(event_types.CHARACTER_GROUP_OVERLAY_STATE_CHANGE_BEFORE, newState)
.then(() => {
this.#state = newState;
eventSource.emit(event_types.CHARACTER_GROUP_OVERLAY_STATE_CHANGE_AFTER, this.state)
});
}
get isLongPress() {
return this.#longPress;
}
set isLongPress(longPress) {
this.#longPress = longPress;
}
get stateChangeCallbacks() {
return this.#stateChangeCallbacks;
}
/**
*
* @returns {*[]}
*/
get selectedCharacters() {
return this.#selectedCharacters;
}
constructor() {
if (bulkEditOverlayInstance instanceof BulkEditOverlay)
return bulkEditOverlayInstance
this.container = document.getElementById(BulkEditOverlay.containerId);
eventSource.on(event_types.CHARACTER_GROUP_OVERLAY_STATE_CHANGE_AFTER, this.handleStateChange);
bulkEditOverlayInstance = Object.freeze(this);
}
/**
* Set the overlay to browse mode
*/
browseState = () => this.state = BulkEditOverlayState.browse;
/**
* Set the overlay to select mode
*/
selectState = () => this.state = BulkEditOverlayState.select;
/**
* Set up a Sortable grid for the loaded page
*/
onPageLoad = () => {
this.browseState();
const elements = this.#getEnabledElements();
elements.forEach(element => element.addEventListener('touchstart', this.handleHold));
elements.forEach(element => element.addEventListener('mousedown', this.handleHold));
elements.forEach(element => element.addEventListener('contextmenu', this.handleDefaultContextMenu));
elements.forEach(element => element.addEventListener('touchend', this.handleLongPressEnd));
elements.forEach(element => element.addEventListener('mouseup', this.handleLongPressEnd));
elements.forEach(element => element.addEventListener('dragend', this.handleLongPressEnd));
elements.forEach(element => element.addEventListener('touchmove', this.handleLongPressEnd));
// Cohee: It only triggers when clicking on a margin between the elements?
// Feel free to fix or remove this, I'm not sure how to.
//this.container.addEventListener('click', this.handleCancelClick);
}
/**
* Handle state changes
*
*
*/
handleStateChange = () => {
switch (this.state) {
case BulkEditOverlayState.browse:
this.container.classList.remove(BulkEditOverlay.selectModeClass);
this.#contextMenuOpen = false;
this.#enableClickEventsForCharacters();
this.#enableClickEventsForGroups();
this.clearSelectedCharacters();
this.disableContextMenu();
this.#disableBulkEditButtonHighlight();
CharacterContextMenu.hide();
break;
case BulkEditOverlayState.select:
this.container.classList.add(BulkEditOverlay.selectModeClass);
this.#disableClickEventsForCharacters();
this.#disableClickEventsForGroups();
this.enableContextMenu();
this.#enableBulkEditButtonHighlight();
break;
}
this.stateChangeCallbacks.forEach(callback => callback(this.state));
}
/**
* Block the browsers native context menu and
* set a click event to hide the custom context menu.
*/
enableContextMenu = () => {
this.container.addEventListener('contextmenu', this.handleContextMenuShow);
document.addEventListener('click', this.handleContextMenuHide);
}
/**
* Remove event listeners, allowing the native browser context
* menu to be opened.
*/
disableContextMenu = () => {
this.container.removeEventListener('contextmenu', this.handleContextMenuShow);
document.removeEventListener('click', this.handleContextMenuHide);
}
handleDefaultContextMenu = (event) => {
if (this.isLongPress) {
event.preventDefault();
event.stopPropagation();
return false;
}
}
/**
* Opens menu on long-press.
*
* @param event - Pointer event
*/
handleHold = (event) => {
if (0 !== event.button && event.type !== 'touchstart') return;
if (this.#contextMenuOpen) {
this.#contextMenuOpen = false;
this.#cancelNextToggle = true;
CharacterContextMenu.hide();
return;
}
let cancel = false;
const cancelHold = (event) => cancel = true;
this.container.addEventListener('mouseup', cancelHold);
this.container.addEventListener('touchend', cancelHold);
this.isLongPress = true;
setTimeout(() => {
if (this.isLongPress && !cancel) {
if (this.state === BulkEditOverlayState.browse) {
this.selectState();
} else if (this.state === BulkEditOverlayState.select) {
this.#contextMenuOpen = true;
CharacterContextMenu.show(...this.#getContextMenuPosition(event));
}
}
this.container.removeEventListener('mouseup', cancelHold);
this.container.removeEventListener('touchend', cancelHold);
},
BulkEditOverlay.longPressDelay);
}
handleLongPressEnd = (event) => {
this.isLongPress = false;
if (this.#contextMenuOpen) event.stopPropagation();
}
handleCancelClick = () => {
if (false === this.#contextMenuOpen) this.state = BulkEditOverlayState.browse;
this.#contextMenuOpen = false;
}
/**
* Returns the position of the mouse/touch location
*
* @param event
* @returns {(boolean|number|*)[]}
*/
#getContextMenuPosition = (event) => [
event.clientX || event.touches[0].clientX,
event.clientY || event.touches[0].clientY,
];
#stopEventPropagation = (event) => {
if (this.#contextMenuOpen) {
this.handleContextMenuHide(event);
}
event.stopPropagation();
}
#enableClickEventsForGroups = () => this.#getDisabledElements().forEach((element) => element.removeEventListener('click', this.#stopEventPropagation));
#disableClickEventsForGroups = () => this.#getDisabledElements().forEach((element) => element.addEventListener('click', this.#stopEventPropagation));
#enableClickEventsForCharacters = () => this.#getEnabledElements().forEach(element => element.removeEventListener('click', this.toggleCharacterSelected));
#disableClickEventsForCharacters = () => this.#getEnabledElements().forEach(element => element.addEventListener('click', this.toggleCharacterSelected));
#enableBulkEditButtonHighlight = () => document.getElementById('bulkEditButton').classList.add('bulk_edit_overlay_active');
#disableBulkEditButtonHighlight = () => document.getElementById('bulkEditButton').classList.remove('bulk_edit_overlay_active');
#getEnabledElements = () => [...this.container.getElementsByClassName(BulkEditOverlay.characterClass)];
#getDisabledElements = () =>[...this.container.getElementsByClassName(BulkEditOverlay.groupClass), ...this.container.getElementsByClassName(BulkEditOverlay.bogusFolderClass)];
toggleCharacterSelected = event => {
event.stopPropagation();
const character = event.currentTarget;
const characterId = character.getAttribute('chid');
const alreadySelected = this.selectedCharacters.includes(characterId)
const legacyBulkEditCheckbox = character.querySelector('.' + BulkEditOverlay.legacySelectedClass);
// Only toggle when context menu is closed and wasn't just closed.
if (!this.#contextMenuOpen && !this.#cancelNextToggle)
if (alreadySelected) {
character.classList.remove(BulkEditOverlay.selectedClass);
if (legacyBulkEditCheckbox) legacyBulkEditCheckbox.checked = false;
this.dismissCharacter(characterId);
} else {
character.classList.add(BulkEditOverlay.selectedClass)
if (legacyBulkEditCheckbox) legacyBulkEditCheckbox.checked = true;
this.selectCharacter(characterId);
}
this.#cancelNextToggle = false;
}
handleContextMenuShow = (event) => {
event.preventDefault();
CharacterContextMenu.show(...this.#getContextMenuPosition(event));
this.#contextMenuOpen = true;
}
handleContextMenuHide = (event) => {
let contextMenu = document.getElementById(BulkEditOverlay.contextMenuId);
if (false === contextMenu.contains(event.target)) {
CharacterContextMenu.hide();
}
}
/**
* Concurrently handle character favorite requests.
*
* @returns {Promise<number>}
*/
handleContextMenuFavorite = () => Promise.all(this.selectedCharacters.map(async characterId => CharacterContextMenu.favorite(characterId)))
.then(() => getCharacters())
.then(() => favsToHotswap())
.then(() => this.browseState())
/**
* Concurrently handle character duplicate requests.
*
* @returns {Promise<number>}
*/
handleContextMenuDuplicate = () => Promise.all(this.selectedCharacters.map(async characterId => CharacterContextMenu.duplicate(characterId)))
.then(() => getCharacters())
.then(() => this.browseState())
/**
* Sequentially handle all character-to-persona conversions.
*
* @returns {Promise<void>}
*/
handleContextMenuPersona = async () => {
for (const characterId of this.selectedCharacters) {
await CharacterContextMenu.persona(characterId)
}
this.browseState();
}
/**
* Request user input before concurrently handle deletion
* requests.
*
* @returns {Promise<number>}
*/
handleContextMenuDelete = () => {
callPopup(
popupMessage.deleteChat(this.selectedCharacters.length), null)
.then((accept) => {
if (true !== accept) return;
const deleteChats = document.getElementById('del_char_checkbox').checked ?? false;
showLoader();
toastr.info("We're deleting your characters, please wait...", 'Working on it');
Promise.all(this.selectedCharacters.map(async characterId => CharacterContextMenu.delete(characterId, deleteChats)))
.then(() => getCharacters())
.then(() => this.browseState())
.finally(() => hideLoader());
}
);
}
/**
* Attaches and opens the tag menu
*/
handleContextMenuTag = () => {
CharacterContextMenu.tag(this.selectedCharacters);
}
addStateChangeCallback = callback => this.stateChangeCallbacks.push(callback);
selectCharacter = characterId => this.selectedCharacters.push(String(characterId));
dismissCharacter = characterId => this.#selectedCharacters = this.selectedCharacters.filter(item => String(characterId) !== item);
/**
* Clears internal character storage and
* removes visual highlight.
*/
clearSelectedCharacters = () => {
document.querySelectorAll('#' + BulkEditOverlay.containerId + ' .' + BulkEditOverlay.selectedClass)
.forEach(element => element.classList.remove(BulkEditOverlay.selectedClass));
this.selectedCharacters.length = 0;
}
}
export { BulkEditOverlayState, CharacterContextMenu, BulkEditOverlay };

View File

@@ -2,7 +2,7 @@
import { callPopup, event_types, eventSource, is_send_press, main_api, substituteParams } from "../script.js";
import { is_group_generating } from "./group-chats.js";
import { TokenHandler } from "./openai.js";
import { Message, TokenHandler } from "./openai.js";
import { power_user } from "./power-user.js";
import { debounce, waitUntilCondition, escapeHtml } from "./utils.js";
@@ -21,6 +21,16 @@ function debouncePromise(func, delay) {
};
}
const DEFAULT_DEPTH = 4;
/**
* @enum {number}
*/
export const INJECTION_POSITION = {
RELATIVE: 0,
ABSOLUTE: 1,
}
/**
* Register migrations for the prompt manager when settings are loaded or an Open AI preset is loaded.
*/
@@ -60,7 +70,7 @@ const registerPromptManagerMigration = () => {
* Represents a prompt.
*/
class Prompt {
identifier; role; content; name; system_prompt;
identifier; role; content; name; system_prompt; position; injection_position; injection_depth;
/**
* Create a new Prompt instance.
@@ -71,13 +81,19 @@ class Prompt {
* @param {string} param0.content - The content of the prompt.
* @param {string} param0.name - The name of the prompt.
* @param {boolean} param0.system_prompt - Indicates if the prompt is a system prompt.
* @param {string} param0.position - The position of the prompt in the prompt list.
* @param {number} param0.injection_position - The insert position of the prompt.
* @param {number} param0.injection_depth - The depth of the prompt in the chat.
*/
constructor({ identifier, role, content, name, system_prompt } = {}) {
constructor({ identifier, role, content, name, system_prompt, position, injection_depth, injection_position } = {}) {
this.identifier = identifier;
this.role = role;
this.content = content;
this.name = name;
this.system_prompt = system_prompt;
this.position = position;
this.injection_depth = injection_depth;
this.injection_position = injection_position;
}
}
@@ -163,6 +179,13 @@ class PromptCollection {
}
function PromptManagerModule() {
this.systemPrompts = [
'main',
'nsfw',
'jailbreak',
'enhanceDefinitions',
];
this.configuration = {
version: 1,
prefix: '',
@@ -273,7 +296,7 @@ PromptManagerModule.prototype.init = function (moduleConfiguration, serviceSetti
this.serviceSettings = serviceSettings;
this.containerElement = document.getElementById(this.configuration.containerIdentifier);
if ('global' === this.configuration.promptOrder.strategy) this.activeCharacter = {id: this.configuration.promptOrder.dummyId};
if ('global' === this.configuration.promptOrder.strategy) this.activeCharacter = { id: this.configuration.promptOrder.dummyId };
this.sanitizeServiceSettings();
@@ -379,6 +402,13 @@ PromptManagerModule.prototype.init = function (moduleConfiguration, serviceSetti
document.getElementById(this.configuration.prefix + 'prompt_manager_popup_entry_form_name').value = prompt.name;
document.getElementById(this.configuration.prefix + 'prompt_manager_popup_entry_form_role').value = 'system';
document.getElementById(this.configuration.prefix + 'prompt_manager_popup_entry_form_prompt').value = prompt.content;
document.getElementById(this.configuration.prefix + 'prompt_manager_popup_entry_form_injection_position').value = prompt.injection_position ?? 0;
document.getElementById(this.configuration.prefix + 'prompt_manager_popup_entry_form_injection_depth').value = prompt.injection_depth ?? DEFAULT_DEPTH;
document.getElementById(this.configuration.prefix + 'prompt_manager_depth_block').style.visibility = prompt.injection_position === INJECTION_POSITION.ABSOLUTE ? 'visible' : 'hidden';
if (!this.systemPrompts.includes(promptId)) {
document.getElementById(this.configuration.prefix + 'prompt_manager_popup_entry_form_injection_position').removeAttribute('disabled');
}
}
// Append prompt to selected character
@@ -671,6 +701,8 @@ PromptManagerModule.prototype.updatePromptWithPromptEditForm = function (prompt)
prompt.name = document.getElementById(this.configuration.prefix + 'prompt_manager_popup_entry_form_name').value;
prompt.role = document.getElementById(this.configuration.prefix + 'prompt_manager_popup_entry_form_role').value;
prompt.content = document.getElementById(this.configuration.prefix + 'prompt_manager_popup_entry_form_prompt').value;
prompt.injection_position = Number(document.getElementById(this.configuration.prefix + 'prompt_manager_popup_entry_form_injection_position').value);
prompt.injection_depth = Number(document.getElementById(this.configuration.prefix + 'prompt_manager_popup_entry_form_injection_depth').value);
}
/**
@@ -700,6 +732,12 @@ PromptManagerModule.prototype.getTokenHandler = function () {
return this.tokenHandler;
}
PromptManagerModule.prototype.isPromptDisabledForActiveCharacter = function (identifier) {
const promptOrderEntry = this.getPromptOrderEntry(this.activeCharacter, identifier);
if (promptOrderEntry) return !promptOrderEntry.enabled;
return false;
}
/**
* Add a prompt to the current character's prompt list.
* @param {object} prompt - The prompt to be added.
@@ -838,7 +876,8 @@ PromptManagerModule.prototype.isPromptEditAllowed = function (prompt) {
* @returns {boolean} True if the prompt can be deleted, false otherwise.
*/
PromptManagerModule.prototype.isPromptToggleAllowed = function (prompt) {
return prompt.marker ? false : !this.configuration.toggleDisabled.includes(prompt.identifier);
const forceTogglePrompts = ['charDescription', 'charPersonality', 'scenario', 'personaDescription', 'worldInfoBefore', 'worldInfoAfter'];
return prompt.marker && !forceTogglePrompts.includes(prompt.identifier) ? false : !this.configuration.toggleDisabled.includes(prompt.identifier);
}
/**
@@ -1083,10 +1122,21 @@ PromptManagerModule.prototype.loadPromptIntoEditForm = function (prompt) {
const nameField = document.getElementById(this.configuration.prefix + 'prompt_manager_popup_entry_form_name');
const roleField = document.getElementById(this.configuration.prefix + 'prompt_manager_popup_entry_form_role');
const promptField = document.getElementById(this.configuration.prefix + 'prompt_manager_popup_entry_form_prompt');
const injectionPositionField = document.getElementById(this.configuration.prefix + 'prompt_manager_popup_entry_form_injection_position');
const injectionDepthField = document.getElementById(this.configuration.prefix + 'prompt_manager_popup_entry_form_injection_depth');
const injectionDepthBlock = document.getElementById(this.configuration.prefix + 'prompt_manager_depth_block');
nameField.value = prompt.name ?? '';
roleField.value = prompt.role ?? '';
promptField.value = prompt.content ?? '';
injectionPositionField.value = prompt.injection_position ?? INJECTION_POSITION.RELATIVE;
injectionDepthField.value = prompt.injection_depth ?? DEFAULT_DEPTH;
injectionDepthBlock.style.visibility = prompt.injection_position === INJECTION_POSITION.ABSOLUTE ? 'visible' : 'hidden';
injectionPositionField.removeAttribute('disabled');
if (this.systemPrompts.includes(prompt.identifier)) {
injectionPositionField.setAttribute('disabled', 'disabled');
}
const resetPromptButton = document.getElementById(this.configuration.prefix + 'prompt_manager_popup_entry_form_reset');
if (true === prompt.system_prompt) {
@@ -1096,10 +1146,23 @@ PromptManagerModule.prototype.loadPromptIntoEditForm = function (prompt) {
resetPromptButton.style.display = 'none';
}
injectionPositionField.removeEventListener('change', (e) => this.handleInjectionPositionChange(e));
injectionPositionField.addEventListener('change', (e) => this.handleInjectionPositionChange(e));
const savePromptButton = document.getElementById(this.configuration.prefix + 'prompt_manager_popup_entry_form_save');
savePromptButton.dataset.pmPrompt = prompt.identifier;
}
PromptManagerModule.prototype.handleInjectionPositionChange = function (event) {
const injectionDepthBlock = document.getElementById(this.configuration.prefix + 'prompt_manager_depth_block');
const injectionPosition = Number(event.target.value);
if (injectionPosition === INJECTION_POSITION.ABSOLUTE) {
injectionDepthBlock.style.visibility = 'visible';
} else {
injectionDepthBlock.style.visibility = 'hidden';
}
}
/**
* Loads a given prompt into the inspect form
* @param {MessageCollection} messages - Prompt object with properties 'name', 'role', 'content', and 'system_prompt'
@@ -1117,12 +1180,10 @@ 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>Name: ${title}, Role: ${role}, Tokens: ${tokens}</span>
<span>Name: ${escapeHtml(title)}, Role: ${role}, Tokens: ${tokens}</span>
<div class="fa-solid fa-circle-chevron-down inline-drawer-icon down"></div>
</div>
<div class="inline-drawer-content">
${content}
</div>
<div class="inline-drawer-content" style="white-space: pre-wrap;">${escapeHtml(content)}</div>
</div>
`;
@@ -1133,9 +1194,11 @@ PromptManagerModule.prototype.loadMessagesIntoInspectForm = function (messages)
const messageList = document.getElementById(this.configuration.prefix + 'prompt_manager_popup_entry_form_inspect_list');
if (0 === messages.getCollection().length) messageList.innerHTML = `<span>This marker does not contain any prompts.</span>`;
const messagesCollection = messages instanceof Message ? [messages] : messages.getCollection();
messages.getCollection().forEach(message => {
if (0 === messagesCollection.length) messageList.innerHTML = `<span>This marker does not contain any prompts.</span>`;
messagesCollection.forEach(message => {
messageList.append(createInlineDrawer(message));
});
}
@@ -1150,10 +1213,17 @@ PromptManagerModule.prototype.clearEditForm = function () {
const nameField = document.getElementById(this.configuration.prefix + 'prompt_manager_popup_entry_form_name');
const roleField = document.getElementById(this.configuration.prefix + 'prompt_manager_popup_entry_form_role');
const promptField = document.getElementById(this.configuration.prefix + 'prompt_manager_popup_entry_form_prompt');
const injectionPositionField = document.getElementById(this.configuration.prefix + 'prompt_manager_popup_entry_form_injection_position');
const injectionDepthField = document.getElementById(this.configuration.prefix + 'prompt_manager_popup_entry_form_injection_depth');
const injectionDepthBlock = document.getElementById(this.configuration.prefix + 'prompt_manager_depth_block');
nameField.value = '';
roleField.selectedIndex = 0;
promptField.value = '';
injectionPositionField.selectedIndex = 0;
injectionPositionField.removeAttribute('disabled');
injectionDepthField.value = DEFAULT_DEPTH;
injectionDepthBlock.style.visibility = 'unset';
roleField.disabled = false;
}
@@ -1433,13 +1503,18 @@ PromptManagerModule.prototype.renderPromptManagerListItems = function () {
}
const encodedName = escapeHtml(prompt.name);
const isSystemPrompt = !prompt.marker && prompt.system_prompt && prompt.injection_position !== INJECTION_POSITION.ABSOLUTE;
const isUserPrompt = !prompt.marker && !prompt.system_prompt && prompt.injection_position !== INJECTION_POSITION.ABSOLUTE;
const isInjectionPrompt = !prompt.marker && prompt.injection_position === INJECTION_POSITION.ABSOLUTE;
listItemHtml += `
<li class="${prefix}prompt_manager_prompt ${draggableClass} ${enabledClass} ${markerClass}" data-pm-identifier="${prompt.identifier}">
<span class="${prefix}prompt_manager_prompt_name" data-pm-name="${encodedName}">
${prompt.marker ? '<span class="fa-solid fa-thumb-tack" title="Marker"></span>' : ''}
${!prompt.marker && prompt.system_prompt ? '<span class="fa-solid fa-square-poll-horizontal" title="Global Prompt"></span>' : ''}
${!prompt.marker && !prompt.system_prompt ? '<span class="fa-solid fa-user" title="User Prompt"></span>' : ''}
${isSystemPrompt ? '<span class="fa-solid fa-square-poll-horizontal" title="Global Prompt"></span>' : ''}
${isUserPrompt ? '<span class="fa-solid fa-user" title="User Prompt"></span>' : ''}
${isInjectionPrompt ? `<span class="fa-solid fa-syringe" title="In-Chat Injection"></span>` : ''}
${this.isPromptInspectionAllowed(prompt) ? `<a class="prompt-manager-inspect-action">${encodedName}</a>` : encodedName}
${isInjectionPrompt ? `<small class="prompt-manager-injection-depth">@ ${prompt.injection_depth}</small>` : ''}
</span>
<span>
<span class="prompt_manager_prompt_controls">

View File

@@ -18,6 +18,8 @@ import {
getThumbnailUrl,
selectCharacterById,
eventSource,
menu_type,
substituteParams,
} from "../script.js";
import {
@@ -31,9 +33,10 @@ import {
SECRET_KEYS,
secret_state,
} from "./secrets.js";
import { debounce, delay, getStringHash, waitUntilCondition } from "./utils.js";
import { debounce, delay, getStringHash, isValidUrl, waitUntilCondition } from "./utils.js";
import { chat_completion_sources, oai_settings } from "./openai.js";
import { getTokenCount } from "./tokenizers.js";
import { isMancer } from "./textgen-settings.js";
var RPanelPin = document.getElementById("rm_button_panel_pin");
@@ -57,9 +60,7 @@ const countTokensDebounced = debounce(RA_CountCharTokens, 1000);
const observer = new MutationObserver(function (mutations) {
mutations.forEach(function (mutation) {
if (mutation.target.id === "online_status_text2" ||
mutation.target.id === "online_status_text3" ||
mutation.target.classList.contains("online_status_text4")) {
if (mutation.target.classList.contains("online_status_text")) {
RA_checkOnlineStatus();
} else if (mutation.target.parentNode === SelectedCharacterTab) {
setTimeout(RA_CountCharTokens, 200);
@@ -171,7 +172,7 @@ export function humanizedDateTime() {
let humanMillisecond =
(baseDate.getMilliseconds() < 10 ? "0" : "") + baseDate.getMilliseconds();
let HumanizedDateTime =
humanYear + "-" + humanMonth + "-" + humanDate + " @" + humanHour + "h " + humanMinute + "m " + humanSecond + "s " + humanMillisecond + "ms";
humanYear + "-" + humanMonth + "-" + humanDate + "@" + humanHour + "h" + humanMinute + "m" + humanSecond + "s";
return HumanizedDateTime;
}
@@ -210,10 +211,12 @@ $("#character_popup").on("input", function () { countTokensDebounced(); });
//function:
export function RA_CountCharTokens() {
let total_tokens = 0;
let permanent_tokens = 0;
$('[data-token-counter]').each(function () {
const counter = $(this);
const input = $(document.getElementById(counter.data('token-counter')));
const isPermanent = counter.data('token-permanent') === true;
const value = String(input.val());
if (input.length === 0) {
@@ -230,10 +233,14 @@ export function RA_CountCharTokens() {
if (input.data('last-value-hash') === valueHash) {
total_tokens += Number(counter.text());
permanent_tokens += isPermanent ? Number(counter.text()) : 0;
} else {
const tokens = getTokenCount(value);
// We substitute macro for existing characters, but not for the character being created
const valueToCount = menu_type === 'create' ? value : substituteParams(value);
const tokens = getTokenCount(valueToCount);
counter.text(tokens);
total_tokens += tokens;
permanent_tokens += isPermanent ? tokens : 0;
input.data('last-value-hash', valueHash);
}
});
@@ -242,6 +249,7 @@ export function RA_CountCharTokens() {
const tokenLimit = Math.max(((main_api !== 'openai' ? max_context : oai_settings.openai_max_context) / 2), 1024);
const showWarning = (total_tokens > tokenLimit);
$('#result_info_total_tokens').text(total_tokens);
$('#result_info_permanent_tokens').text(permanent_tokens);
$('#result_info_text').toggleClass('neutral_warning', showWarning);
$('#chartokenwarning').toggle(showWarning);
}
@@ -259,11 +267,11 @@ async function RA_autoloadchat() {
let active_character_id = Object.keys(characters).find(key => characters[key].avatar === active_character);
if (active_character_id !== null) {
selectCharacterById(String(active_character_id));
await selectCharacterById(String(active_character_id));
}
if (active_group != null) {
openGroupById(String(active_group));
await openGroupById(String(active_group));
}
// if the character list hadn't been loaded yet, try again.
@@ -274,10 +282,16 @@ export async function favsToHotswap() {
const entities = getEntitiesList({ doFilter: false });
const container = $('#right-nav-panel .hotswap');
const template = $('#hotswap_template .hotswapAvatar');
container.empty();
const maxCount = 6;
const DEFAULT_COUNT = 6;
const WIDTH_PER_ITEM = 60; // 50px + 5px gap + 5px padding
const containerWidth = container.outerWidth();
const maxCount = containerWidth > 0 ? Math.floor(containerWidth / WIDTH_PER_ITEM) : DEFAULT_COUNT;
let count = 0;
const promises = [];
const newContainer = container.clone();
newContainer.empty();
for (const entity of entities) {
if (count >= maxCount) {
break;
@@ -310,23 +324,39 @@ export async function favsToHotswap() {
}
if (isCharacter) {
const avatarUrl = getThumbnailUrl('avatar', entity.item.avatar);
$(slot).find('img').attr('src', avatarUrl);
$(slot).attr('title', entity.item.avatar);
const imgLoadPromise = new Promise((resolve) => {
const avatarUrl = getThumbnailUrl('avatar', entity.item.avatar);
$(slot).find('img').attr('src', avatarUrl).on('load', resolve);
$(slot).attr('title', entity.item.avatar);
});
// if the image doesn't load in 500ms, resolve the promise anyway
promises.push(Promise.race([imgLoadPromise, delay(500)]));
}
$(slot).css('cursor', 'pointer');
container.append(slot);
newContainer.append(slot);
count++;
}
// there are 6 slots in total,
if (count < maxCount) { //if any are left over
// don't fill leftover spaces with avatar placeholders
// just evenly space the selected avatars instead
/*
if (count < maxCount) { //if any space is left over
let leftOverSlots = maxCount - count;
for (let i = 1; i <= leftOverSlots; i++) {
container.append(template.clone());
newContainer.append(template.clone());
}
}
*/
await Promise.allSettled(promises);
//helpful instruction message if no characters are favorited
if (count === 0) { container.html(`<small><span><i class="fa-solid fa-star"></i> Favorite characters to add them to HotSwaps</span></small>`) }
//otherwise replace with fav'd characters
if (count > 0) {
container.replaceWith(newContainer);
}
}
//changes input bar and send button display depending on connection status
@@ -341,7 +371,7 @@ function RA_checkOnlineStatus() {
connection_made = false;
} else {
if (online_status !== undefined && online_status !== "no_connection") {
$("#send_textarea").attr("placeholder", `Type a message, or /? for command list`); //on connect, placeholder tells user to type message
$("#send_textarea").attr("placeholder", `Type a message, or /? for help`); //on connect, placeholder tells user to type message
$('#send_form').removeClass("no-connection");
$("#API-status-top").removeClass("fa-plug-circle-exclamation redOverlayGlow");
$("#API-status-top").addClass("fa-plug");
@@ -367,18 +397,21 @@ function RA_autoconnect(PrevApi) {
if (online_status === "no_connection" && LoadLocalBool('AutoConnectEnabled')) {
switch (main_api) {
case 'kobold':
if (api_server && isUrlOrAPIKey(api_server)) {
$("#api_button").click();
if (api_server && isValidUrl(api_server)) {
$("#api_button").trigger('click');
}
break;
case 'novel':
if (secret_state[SECRET_KEYS.NOVEL]) {
$("#api_button_novel").click();
$("#api_button_novel").trigger('click');
}
break;
case 'textgenerationwebui':
if (api_server_textgenerationwebui && isUrlOrAPIKey(api_server_textgenerationwebui)) {
$("#api_button_textgenerationwebui").click();
if (isMancer() && secret_state[SECRET_KEYS.MANCER]) {
$("#api_button_textgenerationwebui").trigger('click');
}
else if (api_server_textgenerationwebui && isValidUrl(api_server_textgenerationwebui)) {
$("#api_button_textgenerationwebui").trigger('click');
}
break;
case 'openai':
@@ -388,8 +421,9 @@ function RA_autoconnect(PrevApi) {
|| (oai_settings.chat_completion_source == chat_completion_sources.WINDOWAI)
|| (secret_state[SECRET_KEYS.OPENROUTER] && oai_settings.chat_completion_source == chat_completion_sources.OPENROUTER)
|| (secret_state[SECRET_KEYS.AI21] && oai_settings.chat_completion_source == chat_completion_sources.AI21)
|| (secret_state[SECRET_KEYS.PALM] && oai_settings.chat_completion_source == chat_completion_sources.PALM)
) {
$("#api_button_openai").click();
$("#api_button_openai").trigger('click');
}
break;
}
@@ -397,21 +431,12 @@ function RA_autoconnect(PrevApi) {
if (!connection_made) {
RA_AC_retries++;
retry_delay = Math.min(retry_delay * 2, 30000); // double retry delay up to to 30 secs
//console.log('connection attempts: ' + RA_AC_retries + ' delay: ' + (retry_delay / 1000) + 's');
setTimeout(RA_autoconnect, retry_delay);
// console.log('connection attempts: ' + RA_AC_retries + ' delay: ' + (retry_delay / 1000) + 's');
// setTimeout(RA_autoconnect, retry_delay);
}
}
}
function isUrlOrAPIKey(string) {
try {
new URL(string);
return true;
} catch (_) {
// return pattern.test(string);
}
}
function OpenNavPanels() {
const deviceInfo = getDeviceInfo();
if (deviceInfo && deviceInfo.device.type === 'desktop') {
@@ -867,13 +892,23 @@ export function initRossMods() {
//this makes the chat input text area resize vertically to match the text size (limited by CSS at 50% window height)
$('#send_textarea').on('input', function () {
const chatBlock = $('#chat');
const originalScrollBottom = chatBlock[0].scrollHeight - (chatBlock.scrollTop() + chatBlock.outerHeight());
this.style.height = window.getComputedStyle(this).getPropertyValue('min-height');
this.style.height = (this.scrollHeight) + 'px';
const newScrollTop = Math.round(chatBlock[0].scrollHeight - (chatBlock.outerHeight() + originalScrollBottom));
chatBlock.scrollTop(newScrollTop);
});
//Regenerate if user swipes on the last mesage in chat
document.addEventListener('swiped-left', function (e) {
if (power_user.gestures === false) {
return
}
if ($(".mes_edit_buttons, .drawer-content, #character_popup, #dialogue_popup, #WorldInfo, #right-nav-panel, #left-nav-panel, #select_chat_popup, #floatingPrompt").is(":visible")) {
return
}
var SwipeButR = $('.swipe_right:last');
var SwipeTargetMesClassParent = $(e.target).closest('.last_mes');
if (SwipeTargetMesClassParent !== null) {
@@ -883,6 +918,12 @@ export function initRossMods() {
}
});
document.addEventListener('swiped-right', function (e) {
if (power_user.gestures === false) {
return
}
if ($(".mes_edit_buttons, .drawer-content, #character_popup, #dialogue_popup, #WorldInfo, #right-nav-panel, #left-nav-panel, #select_chat_popup, #floatingPrompt").is(":visible")) {
return
}
var SwipeButL = $('.swipe_left:last');
var SwipeTargetMesClassParent = $(e.target).closest('.last_mes');
if (SwipeTargetMesClassParent !== null) {
@@ -906,10 +947,13 @@ export function initRossMods() {
}
$(document).on('keydown', function (event) {
processHotkeys(event);
processHotkeys(event.originalEvent);
});
//Additional hotkeys CTRL+ENTER and CTRL+UPARROW
/**
* @param {KeyboardEvent} event
*/
function processHotkeys(event) {
//Enter to send when send_textarea in focus
if ($(':focus').attr('id') === 'send_textarea') {
@@ -943,6 +987,14 @@ export function initRossMods() {
}, 300);
}
// Alt+Enter or AltGr+Enter to Continue
if ((event.altKey || (event.altKey && event.ctrlKey)) && event.key == "Enter") {
if (is_send_press == false) {
console.debug("Continuing with Alt+Enter");
$('#option_continue').trigger('click');
}
}
// Ctrl+Enter for Regeneration Last Response. If editing, accept the edits instead
if (event.ctrlKey && event.key == "Enter") {
const editMesDone = $(".mes_edit_done:visible");
@@ -958,14 +1010,6 @@ export function initRossMods() {
}
}
// Alt+Enter to Continue
if (event.altKey && event.key == "Enter") {
if (is_send_press == false) {
console.debug("Continuing with Alt+Enter");
$('#option_continue').trigger('click');
}
}
// Helper function to check if nanogallery2's lightbox is active
function isNanogallery2LightboxActive() {
// Check if the body has the 'nGY2On' class, adjust this based on actual behavior
@@ -1097,13 +1141,14 @@ export function initRossMods() {
$("#rightNavDrawerIcon").trigger('click');
return
}
if ($(".draggable").is(":visible")) {
// Remove the first matched element
$('.draggable:first').remove();
return;
}
}
if ($(".draggable").is(":visible")) {
// Remove the first matched element
$('.draggable:first').remove();
return;
}
if (event.ctrlKey && /^[1-9]$/.test(event.key)) {

View File

@@ -235,6 +235,7 @@ function loadSettings() {
chat_metadata[metadata_keys.depth] = chat_metadata[metadata_keys.depth] ?? extension_settings.note.defaultDepth ?? DEFAULT_DEPTH;
$('#extension_floating_prompt').val(chat_metadata[metadata_keys.prompt]);
$('#extension_floating_interval').val(chat_metadata[metadata_keys.interval]);
$('#extension_floating_allow_wi_scan').prop('checked', extension_settings.note.allowWIScan ?? false);
$('#extension_floating_depth').val(chat_metadata[metadata_keys.depth]);
$(`input[name="extension_floating_position"][value="${chat_metadata[metadata_keys.position]}"]`).prop('checked', true);
@@ -389,6 +390,11 @@ function onChatChanged() {
$('#extension_floating_default_token_counter').text(tokenCounter3);
}
function onAllowWIScanCheckboxChanged() {
extension_settings.note.allowWIScan = !!$(this).prop('checked');
updateSettings();
}
/**
* Inject author's note options and setup event listeners.
*/
@@ -402,6 +408,7 @@ export function initAuthorsNote() {
$('#extension_floating_default').on('input', onExtensionFloatingDefaultInput);
$('#extension_default_depth').on('input', onDefaultDepthInput);
$('#extension_default_interval').on('input', onDefaultIntervalInput);
$('#extension_floating_allow_wi_scan').on('input', onAllowWIScanCheckboxChanged);
$('input[name="extension_floating_position"]').on('change', onExtensionFloatingPositionInput);
$('input[name="extension_default_position"]').on('change', onDefaultPositionInput);
$('input[name="extension_floating_char_position"]').on('change', onExtensionFloatingCharPositionInput);

View File

@@ -0,0 +1,488 @@
import { callPopup, chat_metadata, eventSource, event_types, generateQuietPrompt, getCurrentChatId, getRequestHeaders, getThumbnailUrl } from "../script.js";
import { saveMetadataDebounced } from "./extensions.js";
import { registerSlashCommand } from "./slash-commands.js";
import { stringFormat } from "./utils.js";
const BG_METADATA_KEY = 'custom_background';
const LIST_METADATA_KEY = 'chat_backgrounds';
/**
* Sets the background for the current chat and adds it to the list of custom backgrounds.
* @param {{url: string, path:string}} backgroundInfo
*/
function forceSetBackground(backgroundInfo) {
saveBackgroundMetadata(backgroundInfo.url);
setCustomBackground();
const list = chat_metadata[LIST_METADATA_KEY] || [];
const bg = backgroundInfo.path;
list.push(bg);
chat_metadata[LIST_METADATA_KEY] = list;
saveMetadataDebounced();
getChatBackgroundsList();
highlightNewBackground(bg);
highlightLockedBackground();
}
async function onChatChanged() {
if (hasCustomBackground()) {
setCustomBackground();
}
else {
unsetCustomBackground();
}
getChatBackgroundsList();
highlightLockedBackground();
}
function getChatBackgroundsList() {
const list = chat_metadata[LIST_METADATA_KEY];
const listEmpty = !Array.isArray(list) || list.length === 0;
$('#bg_custom_content').empty();
$('#bg_chat_hint').toggle(listEmpty);
if (listEmpty) {
return;
}
for (const bg of list) {
const template = getBackgroundFromTemplate(bg, true);
$('#bg_custom_content').append(template);
}
}
function getBackgroundPath(fileUrl) {
return `backgrounds/${fileUrl}`;
}
function highlightLockedBackground() {
$('.bg_example').removeClass('locked');
const lockedBackground = chat_metadata[BG_METADATA_KEY];
if (!lockedBackground) {
return;
}
$(`.bg_example`).each(function () {
const url = $(this).data('url');
if (url === lockedBackground) {
$(this).addClass('locked');
}
});
}
function onLockBackgroundClick(e) {
e.stopPropagation();
const chatName = getCurrentChatId();
if (!chatName) {
toastr.warning('Select a chat to lock the background for it');
return;
}
const relativeBgImage = getUrlParameter(this);
saveBackgroundMetadata(relativeBgImage);
setCustomBackground();
highlightLockedBackground();
}
function onUnlockBackgroundClick(e) {
e.stopPropagation();
removeBackgroundMetadata();
unsetCustomBackground();
highlightLockedBackground();
}
function hasCustomBackground() {
return chat_metadata[BG_METADATA_KEY];
}
function saveBackgroundMetadata(file) {
chat_metadata[BG_METADATA_KEY] = file;
saveMetadataDebounced();
}
function removeBackgroundMetadata() {
delete chat_metadata[BG_METADATA_KEY];
saveMetadataDebounced();
}
function setCustomBackground() {
const file = chat_metadata[BG_METADATA_KEY];
// bg already set
if (document.getElementById("bg_custom").style.backgroundImage == file) {
return;
}
$("#bg_custom").css("background-image", file);
}
function unsetCustomBackground() {
$("#bg_custom").css("background-image", 'none');
}
function onSelectBackgroundClick() {
const isCustom = $(this).attr('custom') === 'true';
const relativeBgImage = getUrlParameter(this);
// if clicked on upload button
if (!relativeBgImage) {
return;
}
// Automatically lock the background if it's custom or other background is locked
if (hasCustomBackground() || isCustom) {
saveBackgroundMetadata(relativeBgImage);
setCustomBackground();
highlightLockedBackground();
} else {
highlightLockedBackground();
}
const customBg = window.getComputedStyle(document.getElementById('bg_custom')).backgroundImage;
// Custom background is set. Do not override the layer below
if (customBg !== 'none') {
return;
}
const bgFile = $(this).attr("bgfile");
const backgroundUrl = getBackgroundPath(bgFile);
// Fetching to browser memory to reduce flicker
fetch(backgroundUrl).then(() => {
$("#bg1").css("background-image", relativeBgImage);
setBackground(bgFile);
}).catch(() => {
console.log('Background could not be set: ' + backgroundUrl);
});
}
async function onCopyToSystemBackgroundClick(e) {
e.stopPropagation();
const bgNames = await getNewBackgroundName(this);
if (!bgNames) {
return;
}
const bgFile = await fetch(bgNames.oldBg);
if (!bgFile.ok) {
toastr.warning('Failed to copy background');
return;
}
const blob = await bgFile.blob();
const file = new File([blob], bgNames.newBg);
const formData = new FormData();
formData.set('avatar', file);
uploadBackground(formData);
const list = chat_metadata[LIST_METADATA_KEY] || [];
const index = list.indexOf(bgNames.oldBg);
list.splice(index, 1);
saveMetadataDebounced();
getChatBackgroundsList();
}
/**
* Gets the new background name from the user.
* @param {Element} referenceElement
* @returns {Promise<{oldBg: string, newBg: string}>}
* */
async function getNewBackgroundName(referenceElement) {
const exampleBlock = $(referenceElement).closest('.bg_example');
const isCustom = exampleBlock.attr('custom') === 'true';
const oldBg = exampleBlock.attr('bgfile');
if (!oldBg) {
console.debug('no bgfile');
return;
}
const fileExtension = oldBg.split('.').pop();
const fileNameBase = isCustom ? oldBg.split('/').pop() : oldBg;
const oldBgExtensionless = fileNameBase.replace(`.${fileExtension}`, '');
const newBgExtensionless = await callPopup('<h3>Enter new background name:</h3>', 'input', oldBgExtensionless);
if (!newBgExtensionless) {
console.debug('no new_bg_extensionless');
return;
}
const newBg = `${newBgExtensionless}.${fileExtension}`;
if (oldBgExtensionless === newBgExtensionless) {
console.debug('new_bg === old_bg');
return;
}
return { oldBg, newBg };
}
async function onRenameBackgroundClick(e) {
e.stopPropagation();
const bgNames = await getNewBackgroundName(this);
if (!bgNames) {
return;
}
const data = { old_bg: bgNames.oldBg, new_bg: bgNames.newBg };
const response = await fetch('/renamebackground', {
method: 'POST',
headers: getRequestHeaders(),
body: JSON.stringify(data),
cache: 'no-cache',
});
if (response.ok) {
await getBackgrounds();
highlightNewBackground(bgNames.newBg);
} else {
toastr.warning('Failed to rename background');
}
}
async function onDeleteBackgroundClick(e) {
e.stopPropagation();
const bgToDelete = $(this).closest('.bg_example');
const url = bgToDelete.data('url');
const isCustom = bgToDelete.attr('custom') === 'true';
const confirm = await callPopup("<h3>Delete the background?</h3>", 'confirm');
const bg = bgToDelete.attr('bgfile');
if (confirm) {
// If it's not custom, it's a built-in background. Delete it from the server
if (!isCustom) {
delBackground(bg);
} else {
const list = chat_metadata[LIST_METADATA_KEY] || [];
const index = list.indexOf(bg);
list.splice(index, 1);
}
const siblingSelector = '.bg_example:not(#form_bg_download)';
const nextBg = bgToDelete.next(siblingSelector);
const prevBg = bgToDelete.prev(siblingSelector);
const anyBg = $(siblingSelector);
if (nextBg.length > 0) {
nextBg.trigger('click');
} else if (prevBg.length > 0) {
prevBg.trigger('click');
} else {
$(anyBg[Math.floor(Math.random() * anyBg.length)]).trigger('click');
}
bgToDelete.remove();
if (url === chat_metadata[BG_METADATA_KEY]) {
removeBackgroundMetadata();
unsetCustomBackground();
highlightLockedBackground();
}
if (isCustom) {
getChatBackgroundsList();
saveMetadataDebounced();
}
}
}
const autoBgPrompt = `Pause your roleplay and choose a location ONLY from the provided list that is the most suitable for the current scene. Do not output any other text:\n{0}`;
async function autoBackgroundCommand() {
/** @type {HTMLElement[]} */
const bgTitles = Array.from(document.querySelectorAll('#bg_menu_content .BGSampleTitle'));
const options = bgTitles.map(x => ({ element: x, text: x.innerText.trim() })).filter(x => x.text.length > 0);
if (options.length == 0) {
toastr.warning('No backgrounds to choose from. Please upload some images to the "backgrounds" folder.');
return;
}
const list = options.map(option => `- ${option.text}`).join('\n');
const prompt = stringFormat(autoBgPrompt, list);
const reply = await generateQuietPrompt(prompt, false, false);
const fuse = new Fuse(options, { keys: ['text'] });
const bestMatch = fuse.search(reply, { limit: 1 });
if (bestMatch.length == 0) {
toastr.warning('No match found. Please try again.');
return;
}
console.debug('Automatically choosing background:', bestMatch);
bestMatch[0].item.element.click();
}
export async function getBackgrounds() {
const response = await fetch("/getbackgrounds", {
method: "POST",
headers: getRequestHeaders(),
body: JSON.stringify({
"": "",
}),
});
if (response.ok === true) {
const getData = await response.json();
//background = getData;
//console.log(getData.length);
$("#bg_menu_content").children('div').remove();
for (const bg of getData) {
const template = getBackgroundFromTemplate(bg, false);
$("#bg_menu_content").append(template);
}
}
}
/**
* Gets the URL of the background
* @param {Element} block
* @returns {string} URL of the background
*/
function getUrlParameter(block) {
return $(block).closest(".bg_example").data("url");
}
/**
* Instantiates a background template
* @param {string} bg Path to background
* @param {boolean} isCustom Whether the background is custom
* @returns {JQuery<HTMLElement>} Background template
*/
function getBackgroundFromTemplate(bg, isCustom) {
const template = $('#background_template .bg_example').clone();
const thumbPath = isCustom ? bg : getThumbnailUrl('bg', bg);
const url = isCustom ? `url("${encodeURI(bg)}")` : `url("${getBackgroundPath(bg)}")`;
const title = isCustom ? bg.split('/').pop() : bg;
const friendlyTitle = title.slice(0, title.lastIndexOf('.'));
template.attr('title', title);
template.attr('bgfile', bg);
template.attr('custom', String(isCustom));
template.data('url', url);
template.css('background-image', `url('${thumbPath}')`);
template.find('.BGSampleTitle').text(friendlyTitle);
return template;
}
async function setBackground(bg) {
jQuery.ajax({
type: "POST", //
url: "/setbackground", //
data: JSON.stringify({
bg: bg,
}),
beforeSend: function () {
},
cache: false,
dataType: "json",
contentType: "application/json",
//processData: false,
success: function (html) { },
error: function (jqXHR, exception) {
console.log(exception);
console.log(jqXHR);
},
});
}
async function delBackground(bg) {
const response = await fetch("/delbackground", {
method: "POST",
headers: getRequestHeaders(),
body: JSON.stringify({
bg: bg,
}),
});
}
function onBackgroundUploadSelected() {
const form = $("#form_bg_download").get(0);
if (!(form instanceof HTMLFormElement)) {
console.error('form_bg_download is not a form');
return;
}
const formData = new FormData(form);
uploadBackground(formData);
form.reset();
}
/**
* Uploads a background to the server
* @param {FormData} formData
*/
function uploadBackground(formData) {
jQuery.ajax({
type: "POST",
url: "/downloadbackground",
data: formData,
beforeSend: function () {
},
cache: false,
contentType: false,
processData: false,
success: async function (bg) {
setBackground(bg);
$("#bg1").css("background-image", `url("${getBackgroundPath(bg)}"`);
await getBackgrounds();
highlightNewBackground(bg);
},
error: function (jqXHR, exception) {
console.log(exception);
console.log(jqXHR);
},
});
}
/**
* @param {string} bg
*/
function highlightNewBackground(bg) {
const newBg = $(`.bg_example[bgfile="${bg}"]`);
const scrollOffset = newBg.offset().top - newBg.parent().offset().top;
$('#Backgrounds').scrollTop(scrollOffset);
newBg.addClass('flash animated');
setTimeout(() => newBg.removeClass('flash animated'), 2000);
}
function onBackgroundFilterInput() {
const filterValue = String($(this).val()).toLowerCase();
$("#bg_menu_content > div").each(function () {
const $bgContent = $(this);
if ($bgContent.attr("title").toLowerCase().includes(filterValue)) {
$bgContent.show();
} else {
$bgContent.hide();
}
});
}
export function initBackgrounds() {
eventSource.on(event_types.CHAT_CHANGED, onChatChanged);
eventSource.on(event_types.FORCE_SET_BACKGROUND, forceSetBackground);
$(document).on("click", '.bg_example', onSelectBackgroundClick);
$(document).on('click', '.bg_example_lock', onLockBackgroundClick);
$(document).on('click', '.bg_example_unlock', onUnlockBackgroundClick);
$(document).on('click', '.bg_example_edit', onRenameBackgroundClick);
$(document).on("click", '.bg_example_cross', onDeleteBackgroundClick);
$(document).on("click", '.bg_example_copy', onCopyToSystemBackgroundClick);
$('#auto_background').on("click", autoBackgroundCommand);
$("#add_bg_button").on('change', onBackgroundUploadSelected);
$("#bg-filter").on("input", onBackgroundFilterInput);
registerSlashCommand('lockbg', onLockBackgroundClick, ['bglock'], " locks a background for the currently selected chat", true, true);
registerSlashCommand('unlockbg', onUnlockBackgroundClick, ['bgunlock'], ' unlocks a background for the currently selected chat', true, true);
registerSlashCommand('autobg', autoBackgroundCommand, ['bgauto'], ' automatically changes the background based on the chat context using the AI request prompt', true, true);
}

View File

@@ -133,6 +133,39 @@ async function saveBookmarkMenu() {
return createNewBookmark(chat.length - 1);
}
export async function createBranch(mesId) {
if (!chat.length) {
toastr.warning('The chat is empty.', 'Branch creation failed');
return;
}
if (mesId < 0 || mesId >= chat.length) {
toastr.warning('Invalid message ID.', 'Branch creation failed');
return;
}
const lastMes = chat[mesId];
const mainChat = selected_group ? groups?.find(x => x.id == selected_group)?.chat_id : characters[this_chid].chat;
const newMetadata = { main_chat: mainChat };
let name = `Branch #${mesId} - ${humanizedDateTime()}`
if (selected_group) {
await saveGroupBookmarkChat(selected_group, name, newMetadata, mesId);
} else {
await saveChat(name, newMetadata, mesId);
}
// append to branches list if it exists
// otherwise create it
if (typeof lastMes.extra !== 'object') {
lastMes.extra = {};
}
if (typeof lastMes.extra['branches'] !== 'object') {
lastMes.extra['branches'] = [];
}
lastMes.extra['branches'].push(name);
return name;
}
async function createNewBookmark(mesId) {
if (!chat.length) {
toastr.warning('The chat is empty.', 'Bookmark creation failed');
@@ -280,7 +313,6 @@ async function convertSoloToGroupChat() {
message.name = character.name;
message.original_avatar = character.avatar;
message.force_avatar = getThumbnailUrl('avatar', character.avatar);
message.is_name = true;
// Allow regens of a single message in group
if (typeof message.extra !== 'object') {

View File

@@ -1,24 +1,44 @@
import { characters, getCharacters, handleDeleteCharacter, callPopup } from "../../../script.js";
import { characters, getCharacters, handleDeleteCharacter, callPopup } from "../script.js";
import {BulkEditOverlay, BulkEditOverlayState} from "./BulkEditOverlay.js";
let is_bulk_edit = false;
const enableBulkEdit = () => {
enableBulkSelect();
(new BulkEditOverlay()).selectState();
// show the delete button
$("#bulkDeleteButton").show();
is_bulk_edit = true;
}
const disableBulkEdit = () => {
disableBulkSelect();
(new BulkEditOverlay()).browseState();
// hide the delete button
$("#bulkDeleteButton").hide();
is_bulk_edit = false;
}
const toggleBulkEditMode = (isBulkEdit) => {
if (isBulkEdit) {
disableBulkEdit();
} else {
enableBulkEdit();
}
}
(new BulkEditOverlay()).addStateChangeCallback((state) => {
if (state === BulkEditOverlayState.select) enableBulkEdit();
if (state === BulkEditOverlayState.browse) disableBulkEdit();
});
/**
* Toggles bulk edit mode on/off when the edit button is clicked.
*/
function onEditButtonClick() {
console.log("Edit button clicked");
// toggle bulk edit mode
if (is_bulk_edit) {
disableBulkSelect();
// hide the delete button
$("#bulkDeleteButton").hide();
is_bulk_edit = false;
} else {
enableBulkSelect();
// show the delete button
$("#bulkDeleteButton").show();
is_bulk_edit = true;
}
toggleBulkEditMode(is_bulk_edit);
}
/**
@@ -64,23 +84,6 @@ async function onDeleteButtonClick() {
}
}
/**
* Adds the bulk edit and delete buttons to the UI.
*/
function addButtons() {
const editButton = $(
"<i id='bulkEditButton' class='fa-solid fa-edit menu_button bulkEditButton' title='Bulk edit characters'></i>"
);
const deleteButton = $(
"<i id='bulkDeleteButton' class='fa-solid fa-trash menu_button bulkDeleteButton' title='Bulk delete characters' style='display: none;'></i>"
);
$("#charListGridToggle").after(editButton, deleteButton);
$("#bulkEditButton").on("click", onEditButtonClick);
$("#bulkDeleteButton").on("click", onDeleteButtonClick);
}
/**
* Enables bulk selection by adding a checkbox next to each character.
*/
@@ -111,7 +114,7 @@ function disableBulkSelect() {
/**
* Entry point that runs on page load.
*/
jQuery(async () => {
addButtons();
// loadSettings();
jQuery(() => {
$("#bulkEditButton").on("click", onEditButtonClick);
$("#bulkDeleteButton").on("click", onDeleteButtonClick);
});

View File

@@ -1,19 +1,17 @@
import {
chat_metadata,
substituteParams,
this_chid,
eventSource,
event_types,
saveSettingsDebounced,
this_chid,
} from "../../../script.js";
import { selected_group } from "../../group-chats.js";
import { extension_settings, saveMetadataDebounced } from "../../extensions.js";
import { getCharaFilename, delay } from "../../utils.js";
import { power_user } from "../../power-user.js";
import { metadataKeys } from "./util.js";
} from "../script.js";
import { extension_settings, saveMetadataDebounced } from "./extensions.js"
import { selected_group } from "./group-chats.js";
import { getCharaFilename, delay } from "./utils.js";
import { power_user } from "./power-user.js";
// Keep track of where your extension is located, name should match repo name
const extensionName = "cfg";
const extensionFolderPath = `scripts/extensions/${extensionName}`;
const extensionName = 'cfg';
const defaultSettings = {
global: {
"guidance_scale": 1,
@@ -180,7 +178,7 @@ async function modifyCharaHtml() {
function loadSettings() {
// Set chat CFG if it exists
$('#chat_cfg_guidance_scale').val(chat_metadata[metadataKeys.guidance_scale] ?? 1.0.toFixed(2));
$('#chat_cfg_guidance_scale_counter').text(chat_metadata[metadataKeys.guidance_scale]?.toFixed(2) ?? 1.0.toFixed(2));
$('#chat_cfg_guidance_scale_counter').val(chat_metadata[metadataKeys.guidance_scale]?.toFixed(2) ?? 1.0.toFixed(2));
$('#chat_cfg_negative_prompt').val(chat_metadata[metadataKeys.negative_prompt] ?? '');
$('#chat_cfg_positive_prompt').val(chat_metadata[metadataKeys.positive_prompt] ?? '');
$('#groupchat_cfg_use_chara').prop('checked', chat_metadata[metadataKeys.groupchat_individual_chars] ?? false);
@@ -199,7 +197,7 @@ function loadSettings() {
if (!promptSeparator.startsWith(`"`)) {
promptSeparatorDisplay.unshift(`"`);
}
if (!promptSeparator.endsWith(`"`)) {
promptSeparatorDisplay.push(`"`);
}
@@ -213,7 +211,7 @@ function loadSettings() {
if (!selected_group) {
const charaCfg = extension_settings.cfg.chara.find((e) => e.name === getCharaFilename());
$('#chara_cfg_guidance_scale').val(charaCfg?.guidance_scale ?? 1.00);
$('#chara_cfg_guidance_scale_counter').text(charaCfg?.guidance_scale?.toFixed(2) ?? 1.0.toFixed(2));
$('#chara_cfg_guidance_scale_counter').val(charaCfg?.guidance_scale?.toFixed(2) ?? 1.0.toFixed(2));
$('#chara_cfg_negative_prompt').val(charaCfg?.negative_prompt ?? '');
$('#chara_cfg_positive_prompt').val(charaCfg?.positive_prompt ?? '');
}
@@ -230,7 +228,7 @@ async function initialLoadSettings() {
// Set global CFG values on load
$('#global_cfg_guidance_scale').val(extension_settings.cfg.global.guidance_scale);
$('#global_cfg_guidance_scale_counter').text(extension_settings.cfg.global.guidance_scale.toFixed(2));
$('#global_cfg_guidance_scale_counter').val(extension_settings.cfg.global.guidance_scale.toFixed(2));
$('#global_cfg_negative_prompt').val(extension_settings.cfg.global.negative_prompt);
$('#global_cfg_positive_prompt').val(extension_settings.cfg.global.positive_prompt);
}
@@ -279,14 +277,8 @@ function migrateSettings() {
}
// This function is called when the extension is loaded
jQuery(async () => {
// This is an example of loading HTML from a file
const windowHtml = $(await $.get(`${extensionFolderPath}/window.html`));
// Append settingsHtml to extensions_settings
// extension_settings and extensions_settings2 are the left and right columns of the settings menu
// Left should be extensions that deal with system functions and right should be visual/UI related
windowHtml.find('#CFGClose').on('click', function () {
export function initCfg() {
$('#CFGClose').on('click', function () {
$("#cfgConfig").transition({
opacity: 0,
duration: 200,
@@ -295,58 +287,58 @@ jQuery(async () => {
setTimeout(function () { $('#cfgConfig').hide() }, 200);
});
windowHtml.find('#chat_cfg_guidance_scale').on('input', function() {
$('#chat_cfg_guidance_scale').on('input', function() {
const numberValue = Number($(this).val());
const success = setChatCfg(numberValue, settingType.guidance_scale);
if (success) {
$('#chat_cfg_guidance_scale_counter').text(numberValue.toFixed(2));
$('#chat_cfg_guidance_scale_counter').val(numberValue.toFixed(2));
}
});
windowHtml.find('#chat_cfg_negative_prompt').on('input', function() {
$('#chat_cfg_negative_prompt').on('input', function() {
setChatCfg($(this).val(), settingType.negative_prompt);
});
windowHtml.find('#chat_cfg_positive_prompt').on('input', function() {
$('#chat_cfg_positive_prompt').on('input', function() {
setChatCfg($(this).val(), settingType.positive_prompt);
});
windowHtml.find('#chara_cfg_guidance_scale').on('input', function() {
$('#chara_cfg_guidance_scale').on('input', function() {
const value = $(this).val();
const success = setCharCfg(value, settingType.guidance_scale);
if (success) {
$('#chara_cfg_guidance_scale_counter').text(Number(value).toFixed(2));
$('#chara_cfg_guidance_scale_counter').val(Number(value).toFixed(2));
}
});
windowHtml.find('#chara_cfg_negative_prompt').on('input', function() {
$('#chara_cfg_negative_prompt').on('input', function() {
setCharCfg($(this).val(), settingType.negative_prompt);
});
windowHtml.find('#chara_cfg_positive_prompt').on('input', function() {
$('#chara_cfg_positive_prompt').on('input', function() {
setCharCfg($(this).val(), settingType.positive_prompt);
});
windowHtml.find('#global_cfg_guidance_scale').on('input', function() {
$('#global_cfg_guidance_scale').on('input', function() {
extension_settings.cfg.global.guidance_scale = Number($(this).val());
$('#global_cfg_guidance_scale_counter').text(extension_settings.cfg.global.guidance_scale.toFixed(2));
$('#global_cfg_guidance_scale_counter').val(extension_settings.cfg.global.guidance_scale.toFixed(2));
saveSettingsDebounced();
});
windowHtml.find('#global_cfg_negative_prompt').on('input', function() {
$('#global_cfg_negative_prompt').on('input', function() {
extension_settings.cfg.global.negative_prompt = $(this).val();
saveSettingsDebounced();
});
windowHtml.find('#global_cfg_positive_prompt').on('input', function() {
$('#global_cfg_positive_prompt').on('input', function() {
extension_settings.cfg.global.positive_prompt = $(this).val();
saveSettingsDebounced();
});
windowHtml.find(`input[name="cfg_prompt_combine"]`).on('input', function() {
const values = windowHtml.find(`input[name="cfg_prompt_combine"]`)
$(`input[name="cfg_prompt_combine"]`).on('input', function() {
const values = $('#cfgConfig').find(`input[name="cfg_prompt_combine"]`)
.filter(":checked")
.map(function() { return parseInt($(this).val()) })
.map(function() { return Number($(this).val()) })
.get()
.filter((e) => !Number.isNaN(e)) || [];
@@ -354,17 +346,17 @@ jQuery(async () => {
saveMetadataDebounced();
});
windowHtml.find(`#cfg_prompt_insertion_depth`).on('input', function() {
$(`#cfg_prompt_insertion_depth`).on('input', function() {
chat_metadata[metadataKeys.prompt_insertion_depth] = Number($(this).val());
saveMetadataDebounced();
});
windowHtml.find(`#cfg_prompt_separator`).on('input', function() {
$(`#cfg_prompt_separator`).on('input', function() {
chat_metadata[metadataKeys.prompt_separator] = $(this).val();
saveMetadataDebounced();
});
windowHtml.find('#groupchat_cfg_use_chara').on('input', function() {
$('#groupchat_cfg_use_chara').on('input', function() {
const checked = !!$(this).prop('checked');
chat_metadata[metadataKeys.groupchat_individual_chars] = checked
@@ -375,20 +367,126 @@ jQuery(async () => {
saveMetadataDebounced();
});
$("#movingDivs").append(windowHtml);
initialLoadSettings();
if (extension_settings.cfg) {
migrateSettings();
}
const buttonHtml = $(await $.get(`${extensionFolderPath}/menuButton.html`));
buttonHtml.on('click', onCfgMenuItemClick)
buttonHtml.appendTo("#options_advanced");
$('#option_toggle_CFG').on('click', onCfgMenuItemClick);
// Hook events
eventSource.on(event_types.CHAT_CHANGED, async () => {
await onChatChanged();
});
});
}
export const cfgType = {
chat: 0,
chara: 1,
global: 2
}
export const metadataKeys = {
guidance_scale: "cfg_guidance_scale",
negative_prompt: "cfg_negative_prompt",
positive_prompt: "cfg_positive_prompt",
prompt_combine: "cfg_prompt_combine",
groupchat_individual_chars: "cfg_groupchat_individual_chars",
prompt_insertion_depth: "cfg_prompt_insertion_depth",
prompt_separator: "cfg_prompt_separator"
}
// Gets the CFG guidance scale
// If the guidance scale is 1, ignore the CFG prompt(s) since it won't be used anyways
export function getGuidanceScale() {
if (!extension_settings.cfg) {
console.warn("CFG extension is not enabled. Skipping CFG guidance.");
return;
}
const charaCfg = extension_settings.cfg.chara?.find((e) => e.name === getCharaFilename(this_chid));
const chatGuidanceScale = chat_metadata[metadataKeys.guidance_scale];
const groupchatCharOverride = chat_metadata[metadataKeys.groupchat_individual_chars] ?? false;
if (chatGuidanceScale && chatGuidanceScale !== 1 && !groupchatCharOverride) {
return {
type: cfgType.chat,
value: chatGuidanceScale
};
}
if ((!selected_group && charaCfg || groupchatCharOverride) && charaCfg?.guidance_scale !== 1) {
return {
type: cfgType.chara,
value: charaCfg.guidance_scale
};
}
if (extension_settings.cfg.global && extension_settings.cfg.global?.guidance_scale !== 1) {
return {
type: cfgType.global,
value: extension_settings.cfg.global.guidance_scale
};
}
}
/**
* Gets the CFG prompt separator.
* @returns {string} The CFG prompt separator
*/
function getCustomSeparator() {
const defaultSeparator = "\n";
try {
if (chat_metadata[metadataKeys.prompt_separator]) {
return JSON.parse(chat_metadata[metadataKeys.prompt_separator]);
}
return defaultSeparator;
} catch {
console.warn("Invalid JSON detected for prompt separator. Using default separator.");
return defaultSeparator;
}
}
// Gets the CFG prompt
export function getCfgPrompt(guidanceScale, isNegative) {
let splitCfgPrompt = [];
const cfgPromptCombine = chat_metadata[metadataKeys.prompt_combine] ?? [];
if (guidanceScale.type === cfgType.chat || cfgPromptCombine.includes(cfgType.chat)) {
splitCfgPrompt.unshift(
substituteParams(
chat_metadata[isNegative ? metadataKeys.negative_prompt : metadataKeys.positive_prompt]
)
);
}
const charaCfg = extension_settings.cfg.chara?.find((e) => e.name === getCharaFilename(this_chid));
if (guidanceScale.type === cfgType.chara || cfgPromptCombine.includes(cfgType.chara)) {
splitCfgPrompt.unshift(
substituteParams(
isNegative ? charaCfg.negative_prompt : charaCfg.positive_prompt
)
);
}
if (guidanceScale.type === cfgType.global || cfgPromptCombine.includes(cfgType.global)) {
splitCfgPrompt.unshift(
substituteParams(
isNegative ? extension_settings.cfg.global.negative_prompt : extension_settings.cfg.global.positive_prompt
)
);
}
const customSeparator = getCustomSeparator();
const combinedCfgPrompt = splitCfgPrompt.filter((e) => e.length > 0).join(customSeparator);
const insertionDepth = chat_metadata[metadataKeys.prompt_insertion_depth] ?? 1;
console.log(`Setting CFG with guidance scale: ${guidanceScale.value}, negatives: ${combinedCfgPrompt}`);
return {
value: combinedCfgPrompt,
depth: insertionDepth
};
}

288
public/scripts/chats.js Normal file
View File

@@ -0,0 +1,288 @@
// Move chat functions here from script.js (eventually)
import {
addCopyToCodeBlocks,
appendMediaToMessage,
callPopup,
chat,
eventSource,
event_types,
getCurrentChatId,
hideSwipeButtons,
name2,
saveChatDebounced,
showSwipeButtons,
} from "../script.js";
import { getBase64Async, humanFileSize, saveBase64AsFile } from "./utils.js";
const fileSizeLimit = 1024 * 1024 * 1; // 1 MB
/**
* Mark message as hidden (system message).
* @param {number} messageId Message ID
* @param {JQuery<Element>} messageBlock Message UI element
* @returns
*/
export async function hideChatMessage(messageId, messageBlock) {
const chatId = getCurrentChatId();
if (!chatId || isNaN(messageId)) return;
const message = chat[messageId];
if (!message) return;
message.is_system = true;
messageBlock.attr('is_system', String(true));
// Reload swipes. Useful when a last message is hidden.
hideSwipeButtons();
showSwipeButtons();
saveChatDebounced();
}
/**
* Mark message as visible (non-system message).
* @param {number} messageId Message ID
* @param {JQuery<Element>} messageBlock Message UI element
* @returns
*/
export async function unhideChatMessage(messageId, messageBlock) {
const chatId = getCurrentChatId();
if (!chatId || isNaN(messageId)) return;
const message = chat[messageId];
if (!message) return;
message.is_system = false;
messageBlock.attr('is_system', String(false));
// Reload swipes. Useful when a last message is hidden.
hideSwipeButtons();
showSwipeButtons();
saveChatDebounced();
}
/**
* Adds a file attachment to the message.
* @param {object} message Message object
* @returns {Promise<void>}
*/
export async function populateFileAttachment(message, inputId = 'file_form_input') {
try {
if (!message) return;
if (!message.extra) message.extra = {};
const fileInput = document.getElementById(inputId);
if (!(fileInput instanceof HTMLInputElement)) return;
const file = fileInput.files[0];
if (!file) return;
// If file is image
if (file.type.startsWith('image/')) {
const base64Img = await getBase64Async(file);
const base64ImgData = base64Img.split(',')[1];
const extension = file.type.split('/')[1];
const imageUrl = await saveBase64AsFile(base64ImgData, name2, file.name, extension);
message.extra.image = imageUrl;
message.extra.inline_image = true;
} else {
const fileText = await file.text();
message.extra.file = {
text: fileText,
size: file.size,
name: file.name,
};
}
} catch (error) {
console.error('Could not upload file', error);
} finally {
$('#file_form').trigger('reset');
}
}
/**
* Validates file to make sure it is not binary or not image.
* @param {File} file File object
* @returns {Promise<boolean>} True if file is valid, false otherwise.
*/
async function validateFile(file) {
const fileText = await file.text();
const isImage = file.type.startsWith('image/');
const isBinary = /^[\x00-\x08\x0E-\x1F\x7F-\xFF]*$/.test(fileText);
if (!isImage && file.size > fileSizeLimit) {
toastr.error(`File is too big. Maximum size is ${humanFileSize(fileSizeLimit)}.`);
return false;
}
// If file is binary
if (isBinary && !isImage) {
toastr.error('Binary files are not supported. Select a text file or image.');
return false;
}
return true;
}
export function hasPendingFileAttachment() {
const fileInput = document.getElementById('file_form_input');
if (!(fileInput instanceof HTMLInputElement)) return false;
const file = fileInput.files[0];
return !!file;
}
/**
* Displays file information in the message sending form.
* @returns {Promise<void>}
*/
async function onFileAttach() {
const fileInput = document.getElementById('file_form_input');
if (!(fileInput instanceof HTMLInputElement)) return;
const file = fileInput.files[0];
if (!file) return;
const isValid = await validateFile(file);
// If file is binary
if (!isValid) {
$('#file_form').trigger('reset');
return;
}
$('#file_form .file_name').text(file.name);
$('#file_form .file_size').text(humanFileSize(file.size));
$('#file_form').removeClass('displayNone');
// Reset form on chat change
eventSource.once(event_types.CHAT_CHANGED, () => {
$('#file_form').trigger('reset');
});
}
/**
* Deletes file from message.
* @param {number} messageId Message ID
*/
async function deleteMessageFile(messageId) {
const confirm = await callPopup('Are you sure you want to delete this file?', 'confirm');
if (!confirm) {
console.debug('Delete file cancelled');
return;
}
const message = chat[messageId];
if (!message?.extra?.file) {
console.debug('Message has no file');
return;
}
delete message.extra.file;
$(`.mes[mesid="${messageId}"] .mes_file_container`).remove();
saveChatDebounced();
}
/**
* Opens file from message in a modal.
* @param {number} messageId Message ID
*/
async function viewMessageFile(messageId) {
const messageText = chat[messageId]?.extra?.file?.text;
if (!messageText) {
console.debug('Message has no file or it is empty');
return;
}
const modalTemplate = $('<div><pre><code></code></pre></div>');
modalTemplate.find('code').addClass('txt').text(messageText);
modalTemplate.addClass('file_modal');
addCopyToCodeBlocks(modalTemplate);
callPopup(modalTemplate, 'text');
}
/**
* Inserts a file embed into the message.
* @param {number} messageId
* @param {JQuery<HTMLElement>} messageBlock
* @returns {Promise<void>}
*/
function embedMessageFile(messageId, messageBlock) {
const message = chat[messageId];
if (!message) {
console.warn('Failed to find message with id', messageId);
return;
}
$('#embed_file_input')
.off('change')
.on('change', parseAndUploadEmbed)
.trigger('click');
async function parseAndUploadEmbed(e) {
const file = e.target.files[0];
if (!file) return;
const isValid = await validateFile(file);
if (!isValid) {
$('#file_form').trigger('reset');
return;
}
await populateFileAttachment(message, 'embed_file_input');
appendMediaToMessage(message, messageBlock);
saveChatDebounced();
}
}
jQuery(function () {
$(document).on('click', '.mes_hide', async function () {
const messageBlock = $(this).closest('.mes');
const messageId = Number(messageBlock.attr('mesid'));
await hideChatMessage(messageId, messageBlock);
});
$(document).on('click', '.mes_unhide', async function () {
const messageBlock = $(this).closest('.mes');
const messageId = Number(messageBlock.attr('mesid'));
await unhideChatMessage(messageId, messageBlock);
});
$(document).on('click', '.mes_file_delete', async function () {
const messageBlock = $(this).closest('.mes');
const messageId = Number(messageBlock.attr('mesid'));
await deleteMessageFile(messageId);
});
$(document).on('click', '.mes_file_open', async function () {
const messageBlock = $(this).closest('.mes');
const messageId = Number(messageBlock.attr('mesid'));
await viewMessageFile(messageId);
});
// Do not change. #attachFile is added by extension.
$(document).on('click', '#attachFile', function () {
$('#file_form_input').trigger('click');
});
$(document).on('click', '.mes_embed', function () {
const messageBlock = $(this).closest('.mes');
const messageId = Number(messageBlock.attr('mesid'));
embedMessageFile(messageId, messageBlock);
});
$('#file_form_input').on('change', onFileAttach);
$('#file_form').on('reset', function () {
$('#file_form').addClass('displayNone');
});
})

View File

@@ -1,4 +1,5 @@
import { callPopup, eventSource, event_types, saveSettings, saveSettingsDebounced, getRequestHeaders, substituteParams, renderTemplate } from "../script.js";
import { callPopup, eventSource, event_types, saveSettings, saveSettingsDebounced, getRequestHeaders, substituteParams, renderTemplate, animation_duration } from "../script.js";
import { hideLoader, showLoader } from "./loader.js";
import { isSubsetOf } from "./utils.js";
export {
getContext,
@@ -11,7 +12,7 @@ export {
ModuleWorkerWrapper,
};
let extensionNames = [];
export let extensionNames = [];
let manifests = {};
const defaultUrl = "http://localhost:5100";
@@ -102,7 +103,7 @@ class ModuleWorkerWrapper {
}
// Called by the extension
async update() {
async update(...args) {
// Don't touch me I'm busy...
if (this.isBusy) {
return;
@@ -111,7 +112,7 @@ class ModuleWorkerWrapper {
// I'm free. Let's update!
try {
this.isBusy = true;
await this.callback();
await this.callback(...args);
}
finally {
this.isBusy = false;
@@ -123,6 +124,7 @@ const extension_settings = {
apiUrl: defaultUrl,
apiKey: '',
autoConnect: false,
notifyUpdates: false,
disabledExtensions: [],
expressionOverrides: [],
memory: {},
@@ -134,7 +136,10 @@ const extension_settings = {
caption: {
refine_mode: false,
},
expressions: {},
expressions: {
/** @type {string[]} */
custom: [],
},
dice: {},
regex: [],
tts: {},
@@ -153,6 +158,11 @@ const extension_settings = {
},
speech_recognition: {},
rvc: {},
hypebot: {},
vectors: {},
variables: {
global: {},
},
};
let modules = [];
@@ -192,7 +202,6 @@ async function doExtrasFetch(endpoint, args) {
}
Object.assign(args.headers, {
'Authorization': `Bearer ${extension_settings.apiKey}`,
'Bypass-Tunnel-Reminder': 'bypass'
});
const response = await fetch(endpoint, args);
@@ -201,7 +210,7 @@ async function doExtrasFetch(endpoint, args) {
async function discoverExtensions() {
try {
const response = await fetch('/discover_extensions');
const response = await fetch('/api/extensions/discover');
if (response.ok) {
const extensions = await response.json();
@@ -338,31 +347,41 @@ function addExtensionsButtonAndMenu() {
$(document.body).append(extensionsMenuHTML);
$('#send_but_sheld').prepend(buttonHTML);
$('#leftSendForm').prepend(buttonHTML);
const button = $('#extensionsMenuButton');
const dropdown = $('#extensionsMenu');
//dropdown.hide();
let popper = Popper.createPopper(button.get(0), dropdown.get(0), {
placement: 'top-end',
placement: 'top-start',
});
$(button).on('click', function () {
popper.update()
dropdown.fadeIn(250);
if (!dropdown.is(':visible')) {
dropdown.fadeIn(animation_duration);
}
});
$("html").on('touchstart mousedown', function (e) {
let clickTarget = $(e.target);
if (dropdown.is(':visible')
&& clickTarget.closest(button).length == 0
&& clickTarget.closest(dropdown).length == 0) {
$(dropdown).fadeOut(250);
const clickTarget = $(e.target);
const noCloseTargets = ['#sd_gen'];
if (dropdown.is(':visible') && !noCloseTargets.some(id => clickTarget.closest(id).length > 0)) {
$(dropdown).fadeOut(animation_duration);
}
});
}
function notifyUpdatesInputHandler() {
extension_settings.notifyUpdates = !!$('#extensions_notify_updates').prop('checked');
saveSettingsDebounced();
if (extension_settings.notifyUpdates) {
checkForExtensionUpdates(true);
}
}
/* $(document).on('click', function (e) {
const target = $(e.target);
if (target.is(dropdown)) return;
@@ -493,8 +512,8 @@ async function generateExtensionHtml(name, manifest, isActive, isDisabled, isExt
isUpToDate = data.isUpToDate;
displayVersion = ` (${branch}-${commitHash.substring(0, 7)})`;
updateButton = isUpToDate ?
`<span class="update-button"><button class="btn_update menu_button" data-name="${name.replace('third-party', '')}" title="Up to date"><i class="fa-solid fa-code-commit"></i></button></span>` :
`<span class="update-button"><button class="btn_update menu_button" data-name="${name.replace('third-party', '')}" title="Update available"><i class="fa-solid fa-download"></i></button></span>`;
`<span class="update-button"><button class="btn_update menu_button" data-name="${name.replace('third-party', '')}" title="Up to date"><i class="fa-solid fa-code-commit fa-fw"></i></button></span>` :
`<span class="update-button"><button class="btn_update menu_button" data-name="${name.replace('third-party', '')}" title="Update available"><i class="fa-solid fa-download fa-fw"></i></button></span>`;
originHtml = `<a href="${origin}" target="_blank" rel="noopener noreferrer">`;
}
@@ -565,7 +584,7 @@ async function getExtensionData(extension) {
function getModuleInformation() {
let moduleInfo = modules.length ? `<p>${DOMPurify.sanitize(modules.join(', '))}</p>` : '<p class="failure">Not connected to the API!</p>';
return `
<h3>Modules provided by your Extensions API:</h3>
<h3>Modules provided by your Extras API:</h3>
${moduleInfo}
`;
}
@@ -574,26 +593,43 @@ function getModuleInformation() {
* Generates the HTML strings for all extensions and displays them in a popup.
*/
async function showExtensionsDetails() {
let htmlDefault = '<h3>Default Extensions:</h3>';
let htmlExternal = '<h3>External Extensions:</h3>';
try {
showLoader();
let htmlDefault = '<h3>Built-in Extensions:</h3>';
let htmlExternal = '<h3>Installed Extensions:</h3>';
const extensions = Object.entries(manifests).sort((a, b) => a[1].loading_order - b[1].loading_order);
const extensions = Object.entries(manifests).sort((a, b) => a[1].loading_order - b[1].loading_order);
const promises = [];
for (const extension of extensions) {
const { isExternal, extensionHtml } = await getExtensionData(extension);
if (isExternal) {
htmlExternal += extensionHtml;
} else {
htmlDefault += extensionHtml;
for (const extension of extensions) {
promises.push(getExtensionData(extension));
}
}
const html = `
${getModuleInformation()}
${htmlDefault}
${htmlExternal}
`;
callPopup(`<div class="extensions_info">${html}</div>`, 'text');
const settledPromises = await Promise.allSettled(promises);
settledPromises.forEach(promise => {
if (promise.status === 'fulfilled') {
const { isExternal, extensionHtml } = promise.value;
if (isExternal) {
htmlExternal += extensionHtml;
} else {
htmlDefault += extensionHtml;
}
}
});
const html = `
${getModuleInformation()}
${htmlDefault}
${htmlExternal}
`;
callPopup(`<div class="extensions_info">${html}</div>`, 'text');
} catch (error) {
toastr.error('Error loading extensions. See browser console for details.');
console.error(error);
} finally {
hideLoader();
}
}
@@ -605,28 +641,44 @@ async function showExtensionsDetails() {
*/
async function onUpdateClick() {
const extensionName = $(this).data('name');
$(this).find('i').addClass('fa-spin');
await updateExtension(extensionName, false);
}
/**
* Updates a third-party extension via the API.
* @param {string} extensionName Extension folder name
* @param {boolean} quiet If true, don't show a success message
*/
async function updateExtension(extensionName, quiet) {
try {
const response = await fetch('/update_extension', {
const response = await fetch('/api/extensions/update', {
method: 'POST',
headers: getRequestHeaders(),
body: JSON.stringify({ extensionName })
});
const data = await response.json();
if (data.isUpToDate) {
toastr.success('Extension is already up to date');
} else {
toastr.success(`Extension updated to ${data.shortCommitHash}`);
if (!quiet) {
showExtensionsDetails();
}
if (data.isUpToDate) {
if (!quiet) {
toastr.success('Extension is already up to date');
}
} else {
toastr.success(`Extension ${extensionName} updated to ${data.shortCommitHash}`);
}
showExtensionsDetails();
} catch (error) {
console.error('Error:', error);
}
};
}
/**
* Handles the click event for the delete button of an extension.
* This function makes a POST request to '/delete_extension' with the extension's name.
* This function makes a POST request to '/api/extensions/delete' with the extension's name.
* If the extension is deleted, it displays a success message.
* Creates a popup for the user to confirm before delete.
*/
@@ -635,23 +687,26 @@ async function onDeleteClick() {
// use callPopup to create a popup for the user to confirm before delete
const confirmation = await callPopup(`Are you sure you want to delete ${extensionName}?`, 'delete_extension');
if (confirmation) {
try {
const response = await fetch('/delete_extension', {
method: 'POST',
headers: getRequestHeaders(),
body: JSON.stringify({ extensionName })
});
} catch (error) {
console.error('Error:', error);
}
toastr.success(`Extension ${extensionName} deleted`);
showExtensionsDetails();
// reload the page to remove the extension from the list
location.reload();
await deleteExtension(extensionName);
}
};
export async function deleteExtension(extensionName) {
try {
const response = await fetch('/api/extensions/delete', {
method: 'POST',
headers: getRequestHeaders(),
body: JSON.stringify({ extensionName })
});
} catch (error) {
console.error('Error:', error);
}
toastr.success(`Extension ${extensionName} deleted`);
showExtensionsDetails();
// reload the page to remove the extension from the list
location.reload();
}
/**
* Fetches the version details of a specific extension.
@@ -663,7 +718,7 @@ async function onDeleteClick() {
*/
async function getExtensionVersion(extensionName) {
try {
const response = await fetch('/get_extension_version', {
const response = await fetch('/api/extensions/version', {
method: 'POST',
headers: getRequestHeaders(),
body: JSON.stringify({ extensionName })
@@ -676,9 +731,42 @@ async function getExtensionVersion(extensionName) {
}
}
/**
* Installs a third-party extension via the API.
* @param {string} url Extension repository URL
* @returns {Promise<void>}
*/
export async function installExtension(url) {
console.debug('Extension installation started', url);
toastr.info('Please wait...', 'Installing extension');
async function loadExtensionSettings(settings) {
const request = await fetch('/api/extensions/install', {
method: 'POST',
headers: getRequestHeaders(),
body: JSON.stringify({ url }),
});
if (!request.ok) {
const text = await request.text();
toastr.warning(text || request.statusText, 'Extension installation failed', { timeOut: 5000 });
console.error('Extension installation failed', request.status, request.statusText, text);
return;
}
const response = await request.json();
toastr.success(`Extension "${response.display_name}" by ${response.author} (version ${response.version}) has been installed successfully!`, 'Extension installation successful');
console.debug(`Extension "${response.display_name}" has been installed successfully at ${response.extensionPath}`);
await loadExtensionSettings({}, false);
eventSource.emit(event_types.EXTENSION_SETTINGS_LOADED);
}
/**
* Loads extension settings from the app settings.
* @param {object} settings App Settings
* @param {boolean} versionChanged Is this a version change?
*/
async function loadExtensionSettings(settings, versionChanged) {
if (settings.extension_settings) {
Object.assign(extension_settings, settings.extension_settings);
}
@@ -686,28 +774,124 @@ async function loadExtensionSettings(settings) {
$("#extensions_url").val(extension_settings.apiUrl);
$("#extensions_api_key").val(extension_settings.apiKey);
$("#extensions_autoconnect").prop('checked', extension_settings.autoConnect);
$("#extensions_notify_updates").prop('checked', extension_settings.notifyUpdates);
// Activate offline extensions
eventSource.emit(event_types.EXTENSIONS_FIRST_LOAD);
extensionNames = await discoverExtensions();
manifests = await getManifests(extensionNames)
if (versionChanged) {
await autoUpdateExtensions();
}
await activateExtensions();
if (extension_settings.autoConnect && extension_settings.apiUrl) {
connectToApi(extension_settings.apiUrl);
}
}
export function doDailyExtensionUpdatesCheck() {
setTimeout(() => {
if (extension_settings.notifyUpdates) {
checkForExtensionUpdates(false);
}
}, 1);
}
/**
* Checks if there are updates available for 3rd-party extensions.
* @param {boolean} force Skip nag check
* @returns {Promise<any>}
*/
async function checkForExtensionUpdates(force) {
if (!force) {
const STORAGE_NAG_KEY = 'extension_update_nag';
const currentDate = new Date().toDateString();
// Don't nag more than once a day
if (localStorage.getItem(STORAGE_NAG_KEY) === currentDate) {
return;
}
localStorage.setItem(STORAGE_NAG_KEY, currentDate);
}
const updatesAvailable = [];
const promises = [];
for (const [id, manifest] of Object.entries(manifests)) {
if (manifest.auto_update && id.startsWith('third-party')) {
const promise = new Promise(async (resolve, reject) => {
try {
const data = await getExtensionVersion(id.replace('third-party', ''));
if (data.isUpToDate === false) {
updatesAvailable.push(manifest.display_name);
}
resolve();
} catch (error) {
console.error('Error checking for extension updates', error);
reject();
}
});
promises.push(promise);
}
}
await Promise.allSettled(promises);
if (updatesAvailable.length > 0) {
toastr.info(`${updatesAvailable.map(x => `${x}`).join('\n')}`, 'Extension updates available');
}
}
async function autoUpdateExtensions() {
if (!Object.values(manifests).some(x => x.auto_update)) {
return;
}
toastr.info('Auto-updating extensions. This may take several minutes.', 'Please wait...', { timeOut: 10000, extendedTimeOut: 20000 });
const promises = [];
for (const [id, manifest] of Object.entries(manifests)) {
if (manifest.auto_update && id.startsWith('third-party')) {
console.debug(`Auto-updating 3rd-party extension: ${manifest.display_name} (${id})`);
promises.push(updateExtension(id.replace('third-party', ''), true));
}
}
await Promise.allSettled(promises);
}
/**
* Runs the generate interceptors for all extensions.
* @param {any[]} chat Chat array
* @param {number} contextSize Context size
* @returns {Promise<boolean>} True if generation should be aborted
*/
async function runGenerationInterceptors(chat, contextSize) {
let aborted = false;
let exitImmediately = false;
const abort = (/** @type {boolean} */ immediately) => {
aborted = true;
exitImmediately = immediately;
};
for (const manifest of Object.values(manifests)) {
const interceptorKey = manifest.generate_interceptor;
if (typeof window[interceptorKey] === 'function') {
try {
await window[interceptorKey](chat, contextSize);
await window[interceptorKey](chat, contextSize, abort);
} catch (e) {
console.error(`Failed running interceptor for ${manifest.display_name}`, e);
}
}
if (exitImmediately) {
break;
}
}
return aborted;
}
jQuery(function () {
@@ -717,8 +901,36 @@ jQuery(function () {
$("#extensions_connect").on('click', connectClickHandler);
$("#extensions_autoconnect").on('input', autoConnectInputHandler);
$("#extensions_details").on('click', showExtensionsDetails);
$("#extensions_notify_updates").on('input', notifyUpdatesInputHandler);
$(document).on('click', '.toggle_disable', onDisableExtensionClick);
$(document).on('click', '.toggle_enable', onEnableExtensionClick);
$(document).on('click', '.btn_update', onUpdateClick);
$(document).on('click', '.btn_delete', onDeleteClick);
/**
* Handles the click event for the third-party extension import button.
* Prompts the user to enter the Git URL of the extension to import.
* After obtaining the Git URL, makes a POST request to '/api/extensions/install' to import the extension.
* If the extension is imported successfully, a success message is displayed.
* If the extension import fails, an error message is displayed and the error is logged to the console.
* After successfully importing the extension, the extension settings are reloaded and a 'EXTENSION_SETTINGS_LOADED' event is emitted.
*
* @listens #third_party_extension_button#click - The click event of the '#third_party_extension_button' element.
*/
$('#third_party_extension_button').on('click', async () => {
const html = `<h3>Enter the Git URL of the extension to install</h3>
<br>
<p><b>Disclaimer:</b> Please be aware that using external extensions can have unintended side effects and may pose security risks. Always make sure you trust the source before importing an extension. We are not responsible for any damage caused by third-party extensions.</p>
<br>
<p>Example: <tt> https://github.com/author/extension-name </tt></p>`
const input = await callPopup(html, 'input');
if (!input) {
console.debug('Extension install cancelled');
return;
}
const url = input.trim();
await installExtension(url);
});
});

View File

@@ -0,0 +1,9 @@
<div class="m-b-1">
Are you sure you want to connect to '{{url}}'?
</div>
<div class="flex-container justifyCenter">
<label class="checkbox_label" for="assets-remember">
<input type="checkbox" id="assets-remember">
Don't ask again for this URL
</label>
</div>

View File

@@ -1,14 +1,16 @@
/*
TODO:
- Check failed install file (0kb size ?)
*/
//const DEBUG_TONY_SAMA_FORK_MODE = false
//const DEBUG_TONY_SAMA_FORK_MODE = true
import { getRequestHeaders, callPopup } from "../../../script.js";
import { deleteExtension, extensionNames, installExtension, renderExtensionTemplate } from "../../extensions.js";
import { getStringHash, isValidUrl } from "../../utils.js";
export { MODULE_NAME };
const MODULE_NAME = 'Assets';
const MODULE_NAME = 'assets';
const DEBUG_PREFIX = "<Assets module> ";
let previewAudio = null;
let ASSETS_JSON_URL = "https://raw.githubusercontent.com/SillyTavern/SillyTavern-Content/main/index.json"
const extensionName = "assets";
@@ -29,7 +31,7 @@ const defaultSettings = {
function downloadAssetsList(url) {
updateCurrentAssets().then(function () {
fetch(url)
fetch(url, { cache: "no-cache" })
.then(response => response.json())
.then(json => {
@@ -47,19 +49,29 @@ function downloadAssetsList(url) {
}
console.debug(DEBUG_PREFIX, "Updated available assets to", availableAssets);
// First extensions, then everything else
const assetTypes = Object.keys(availableAssets).sort((a, b) => (a === 'extension') ? -1 : (b === 'extension') ? 1 : 0);
for (const assetType in availableAssets) {
for (const assetType of assetTypes) {
let assetTypeMenu = $('<div />', { id: "assets_audio_ambient_div", class: "assets-list-div" });
assetTypeMenu.append(`<h3>${assetType}</h3>`)
if (assetType == 'extension') {
assetTypeMenu.append(`
<div class="assets-list-git">
To download extensions from this page, you need to have <a href="https://git-scm.com/downloads" target="_blank">Git</a> installed.
</div>`);
}
for (const i in availableAssets[assetType]) {
const asset = availableAssets[assetType][i];
const elemId = `assets_install_${assetType}_${i}`;
let element = $('<button />', { id: elemId, type: "button", class: "asset-download-button menu_button" })
const label = $("<i class=\"fa-solid fa-download fa-xl\"></i>");
const label = $("<i class=\"fa-fw fa-solid fa-download fa-xl\"></i>");
element.append(label);
//if (DEBUG_TONY_SAMA_FORK_MODE)
// assetUrl = assetUrl.replace("https://github.com/SillyTavern/","https://github.com/Tony-sama/"); // DBG
// asset["url"] = asset["url"].replace("https://github.com/SillyTavern/","https://github.com/Tony-sama/"); // DBG
console.debug(DEBUG_PREFIX, "Checking asset", asset["id"], asset["url"]);
@@ -71,18 +83,18 @@ function downloadAssetsList(url) {
label.addClass("fa-check");
this.classList.remove('asset-download-button-loading');
element.on("click", assetDelete);
element.on("mouseenter", function(){
element.on("mouseenter", function () {
label.removeClass("fa-check");
label.addClass("fa-trash");
label.addClass("redOverlayGlow");
}).on("mouseleave", function(){
}).on("mouseleave", function () {
label.addClass("fa-check");
label.removeClass("fa-trash");
label.removeClass("redOverlayGlow");
});
};
const assetDelete = async function() {
const assetDelete = async function () {
element.off("click");
await deleteAsset(assetType, asset["id"]);
label.removeClass("fa-check");
@@ -98,11 +110,11 @@ function downloadAssetsList(url) {
label.toggleClass("fa-download");
label.toggleClass("fa-check");
element.on("click", assetDelete);
element.on("mouseenter", function(){
element.on("mouseenter", function () {
label.removeClass("fa-check");
label.addClass("fa-trash");
label.addClass("redOverlayGlow");
}).on("mouseleave", function(){
}).on("mouseleave", function () {
label.addClass("fa-check");
label.removeClass("fa-trash");
label.removeClass("redOverlayGlow");
@@ -114,14 +126,28 @@ function downloadAssetsList(url) {
element.on("click", assetInstall);
}
console.debug(DEBUG_PREFIX, "Created element for BGM", asset["id"])
console.debug(DEBUG_PREFIX, "Created element for ", asset["id"])
const displayName = DOMPurify.sanitize(asset["name"] || asset["id"]);
const description = DOMPurify.sanitize(asset["description"] || "");
const url = isValidUrl(asset["url"]) ? asset["url"] : "";
const previewIcon = assetType == 'extension' ? 'fa-arrow-up-right-from-square' : 'fa-headphones-simple';
$(`<i></i>`)
.append(element)
.append(`<span>${asset["id"]}</span>`)
.append(`<div class="flex-container flexFlowColumn">
<span class="flex-container alignitemscenter">
<b>${displayName}</b>
<a class="asset_preview" href="${url}" target="_blank" title="Preview in browser">
<i class="fa-solid fa-sm ${previewIcon}"></i>
</a>
</span>
<span>${description}</span>
</div>`)
.appendTo(assetTypeMenu);
}
assetTypeMenu.appendTo("#assets_menu");
assetTypeMenu.on('click', 'a.asset_preview', previewAsset);
}
$("#assets_menu").show();
@@ -135,8 +161,37 @@ function downloadAssetsList(url) {
});
}
function previewAsset(e) {
const href = $(this).attr('href');
const audioExtensions = ['.mp3', '.ogg', '.wav'];
if (audioExtensions.some(ext => href.endsWith(ext))) {
e.preventDefault();
if (previewAudio) {
previewAudio.pause();
if (previewAudio.src === href) {
previewAudio = null;
return;
}
}
previewAudio = new Audio(href);
previewAudio.play();
return;
}
}
function isAssetInstalled(assetType, filename) {
for (const i of currentAssets[assetType]) {
let assetList = currentAssets[assetType];
if (assetType == 'extension') {
const thirdPartyMarker = "third-party/";
assetList = extensionNames.filter(x => x.startsWith(thirdPartyMarker)).map(x => x.replace(thirdPartyMarker, ''));
}
for (const i of assetList) {
//console.debug(DEBUG_PREFIX,i,filename)
if (i.includes(filename))
return true;
@@ -149,8 +204,15 @@ async function installAsset(url, assetType, filename) {
console.debug(DEBUG_PREFIX, "Downloading ", url);
const category = assetType;
try {
if (category === 'extension') {
console.debug(DEBUG_PREFIX, "Installing extension ", url)
await installExtension(url);
console.debug(DEBUG_PREFIX, "Extension installed.")
return;
}
const body = { url, category, filename };
const result = await fetch('/asset_download', {
const result = await fetch('/api/assets/download', {
method: 'POST',
headers: getRequestHeaders(),
body: JSON.stringify(body),
@@ -170,8 +232,14 @@ async function deleteAsset(assetType, filename) {
console.debug(DEBUG_PREFIX, "Deleting ", assetType, filename);
const category = assetType;
try {
if (category === 'extension') {
console.debug(DEBUG_PREFIX, "Deleting extension ", filename)
await deleteExtension(filename);
console.debug(DEBUG_PREFIX, "Extension deleted.")
}
const body = { category, filename };
const result = await fetch('/asset_delete', {
const result = await fetch('/api/assets/delete', {
method: 'POST',
headers: getRequestHeaders(),
body: JSON.stringify(body),
@@ -194,7 +262,7 @@ async function deleteAsset(assetType, filename) {
async function updateCurrentAssets() {
console.debug(DEBUG_PREFIX, "Checking installed assets...")
try {
const result = await fetch(`/get_assets`, {
const result = await fetch(`/api/assets/get`, {
method: 'POST',
headers: getRequestHeaders(),
});
@@ -214,24 +282,35 @@ async function updateCurrentAssets() {
// This function is called when the extension is loaded
jQuery(async () => {
// This is an example of loading HTML from a file
const windowHtml = $(await $.get(`${extensionFolderPath}/window.html`));
const windowHtml = $(renderExtensionTemplate(MODULE_NAME, 'window', {}));
const assetsJsonUrl = windowHtml.find('#assets-json-url-field');
assetsJsonUrl.val(ASSETS_JSON_URL);
const connectButton = windowHtml.find('#assets-connect-button');
connectButton.on("click", async function () {
const confirmation = await callPopup(`Are you sure you want to connect to '${assetsJsonUrl.val()}'?`, 'confirm')
const url = String(assetsJsonUrl.val());
const rememberKey = `Assets_SkipConfirm_${getStringHash(url)}`;
const skipConfirm = localStorage.getItem(rememberKey) === 'true';
const template = renderExtensionTemplate(MODULE_NAME, 'confirm', { url });
const confirmation = skipConfirm || await callPopup(template, 'confirm');
if (confirmation) {
try {
if (!skipConfirm) {
const rememberValue = Boolean($('#assets-remember').prop('checked'));
localStorage.setItem(rememberKey, String(rememberValue));
}
console.debug(DEBUG_PREFIX, "Confimation, loading assets...");
downloadAssetsList(assetsJsonUrl.val());
downloadAssetsList(url);
connectButton.removeClass("fa-plug-circle-exclamation");
connectButton.removeClass("redOverlayGlow");
connectButton.addClass("fa-plug-circle-check");
} catch (error) {
console.error('Error:', error);
toastr.error(`Cannot get assets list from ${assetsJsonUrl.val()}`);
toastr.error(`Cannot get assets list from ${url}`);
connectButton.removeClass("fa-plug-circle-check");
connectButton.addClass("fa-plug-circle-exclamation");
connectButton.removeClass("redOverlayGlow");

Some files were not shown because too many files have changed in this diff Show More