Merge branch 'staging' into delete-newbie-mode
| @@ -344,7 +344,6 @@ | ||
| 344 | 344 | |
| 345 | 345 | @media screen and (min-width: 1001px) { |
| 346 | 346 | |
| 347 | - #PygOverrides, | |
| 348 | 347 | #ContextFormatting, |
| 349 | 348 | #UI-Theme-Block, |
| 350 | 349 | #UI-Customization, |
| @@ -360,6 +360,10 @@ | ||
| 360 | 360 | margin-right: 2px; |
| 361 | 361 | } |
| 362 | 362 | |
| 363 | +.flexAuto { | |
| 364 | + flex: auto; | |
| 365 | +} | |
| 366 | + | |
| 363 | 367 | .flex0 { |
| 364 | 368 | flex: 0; |
| 365 | 369 | } |
| @@ -490,7 +494,8 @@ | ||
| 490 | 494 | } |
| 491 | 495 | |
| 492 | 496 | input:disabled, |
| 493 | 497 | textarea:disabled {, |
| 498 | +.disabled { | |
| 494 | 499 | cursor: not-allowed; |
| 495 | 500 | filter: brightness(0.5); |
| 496 | 501 | } |
| @@ -1488,7 +1488,7 @@ | ||
| 1488 | 1488 | </div> |
| 1489 | 1489 | <div data-tg-type="mancer, ooba, koboldcpp, vllm, aphrodite, llamacpp, ollama, infermaticai, huggingface" data-newbie-hidden class="flex-container flexFlowColumn alignitemscenter flexBasis48p flexGrow flexShrink gap0"> |
| 1490 | 1490 | <small data-i18n="Seed" class="textAlignCenter">Seed</small> |
| 1491 | 1491 | <input type="number" id="seed_textgenerationwebui" class="text_pole textAlignCenter" min="-1" value="-1" maxlength="100" /> |
| 1492 | 1492 | </div> |
| 1493 | 1493 | <div id="banned_tokens_block_ooba" data-newbie-hidden class="wide100p"> |
| 1494 | 1494 | <hr data-newbie-hidden class="width100p"> |
| @@ -1820,12 +1820,12 @@ | ||
| 1820 | 1820 | <span id="claude_assistant_prefill_text" data-i18n="Assistant Prefill">Assistant Prefill</span> |
| 1821 | 1821 | <i class="editor_maximize fa-solid fa-maximize right_menu_button" data-for="claude_assistant_prefill" title="Expand the editor" data-i18n="[title]Expand the editor"></i> |
| 1822 | 1822 | </div> |
| 1823 | 1823 | <textarea id="claude_assistant_prefill" class="text_pole textarea_compact" name="assistant_prefill" rows="6" maxlength="100000" data-i18n="[placeholder]Start Claude's answer with..." placeholder="Start Claude's answer with..."></textarea> |
| 1824 | 1824 | <div class="flex-container alignItemsCenter"> |
| 1825 | 1825 | <span id="claude_assistant_impersonation_text" data-i18n="Assistant Impersonation Prefill">Assistant Impersonation Prefill</span> |
| 1826 | 1826 | <i class="editor_maximize fa-solid fa-maximize right_menu_button" data-for="claude_assistant_impersonation" title="Expand the editor" data-i18n="[title]Expand the editor"></i> |
| 1827 | 1827 | </div> |
| 1828 | 1828 | <textarea id="claude_assistant_impersonation" class="text_pole textarea_compact" name="assistant_impersonation" rows="6" maxlength="100000" data-i18n="[placeholder]Start Claude's answer with..." placeholder="Start Claude's answer with..."></textarea> |
| 1829 | 1829 | </div> |
| 1830 | 1830 | <label for="claude_use_sysprompt" class="checkbox_label widthFreeExpand"> |
| 1831 | 1831 | <input id="claude_use_sysprompt" type="checkbox" /> |
| @@ -1951,7 +1951,7 @@ | ||
| 1951 | 1951 | <a id="horde_kudos" href="javascript:void(0);">View my Kudos</a> |
| 1952 | 1952 | </div> --> |
| 1953 | 1953 | <div class="flex-container"> |
| 1954 | 1954 | <input id="horde_api_key" name="horde_api_key" class="text_pole flex1" maxlength="500" type="text" placeholder="0000000000" autocomplete="off"> |
| 1955 | 1955 | <div title="Clear your API key" data-i18n="[title]Clear your API key" class="menu_button fa-solid fa-circle-xmark clear-api-key" data-key="api_key_horde"></div> |
| 1956 | 1956 | </div> |
| 1957 | 1957 | <div data-for="horde_api_key" class="neutral_warning" data-i18n="For privacy reasons, your API key will be hidden after you reload the page."> |
| @@ -1978,7 +1978,7 @@ | ||
| 1978 | 1978 | <div id="kobold_api_block"> |
| 1979 | 1979 | <h4 data-i18n="API url">API url</h4> |
| 1980 | 1980 | <small data-i18n="Example: http://127.0.0.1:5000/api ">Example: http://127.0.0.1:5000/api </small> |
| 1981 | 1981 | <input id="api_url_text" name="api_url" class="text_pole" placeholder="http://127.0.0.1:5000/api" maxlength="500" value="" autocomplete="off" data-server-history="kobold"> |
| 1982 | 1982 | <div id="koboldcpp_hint" class="neutral_warning displayNone"> |
| 1983 | 1983 | KoboldCpp works better when you select the Text Completion API and then KoboldCpp as a type! |
| 1984 | 1984 | </div> |
| @@ -2006,7 +2006,7 @@ | ||
| 2006 | 2006 | </ol> |
| 2007 | 2007 | </span> |
| 2008 | 2008 | <div class="flex-container"> |
| 2009 | 2009 | <input id="api_key_novel" name="api_key_novel" class="text_pole flex1 wide100p" maxlength="500" size="35" type="text" autocomplete="off"> |
| 2010 | 2010 | <div title="Clear your API key" data-i18n="[title]Clear your API key" class="menu_button fa-solid fa-circle-xmark clear-api-key" data-key="api_key_novel"> |
| 2011 | 2011 | </div> |
| 2012 | 2012 | </div> |
| @@ -2056,7 +2056,7 @@ | ||
| 2056 | 2056 | <div data-tg-type="togetherai" class="flex-container flexFlowColumn"> |
| 2057 | 2057 | <h4 data-i18n="TogetherAI API Key">TogetherAI API Key</h4> |
| 2058 | 2058 | <div class="flex-container"> |
| 2059 | 2059 | <input id="api_key_togetherai" name="api_key_togetherai" class="text_pole flex1" maxlength="500" value="" type="text" autocomplete="off"> |
| 2060 | 2060 | <div title="Clear your API key" data-i18n="[title]Clear your API key" class="menu_button fa-solid fa-circle-xmark clear-api-key" data-key="api_key_togetherai"></div> |
| 2061 | 2061 | </div> |
| 2062 | 2062 | <div data-for="api_key_togetherai" class="neutral_warning" data-i18n="For privacy reasons, your API key will be hidden after you reload the page."> |
| @@ -2080,7 +2080,7 @@ | ||
| 2080 | 2080 | <a href="https://openrouter.ai/account" target="_blank" data-i18n="View Remaining Credits">View Remaining Credits</a> |
| 2081 | 2081 | </div> |
| 2082 | 2082 | <div class="flex-container"> |
| 2083 | 2083 | <input id="api_key_openrouter-tg" name="api_key_openrouter" class="text_pole flex1 api_key_openrouter" maxlength="500" value="" type="text" autocomplete="off"> |
| 2084 | 2084 | <div title="Clear your API key" data-i18n="[title]Clear your API key" class="menu_button fa-solid fa-circle-xmark clear-api-key" data-key="api_key_openrouter"></div> |
| 2085 | 2085 | </div> |
| 2086 | 2086 | <div data-for="api_key_openrouter" class="neutral_warning" data-i18n="For privacy reasons, your API key will be hidden after you reload the page."> |
| @@ -2107,7 +2107,7 @@ | ||
| 2107 | 2107 | <div data-tg-type="infermaticai" class="flex-container flexFlowColumn"> |
| 2108 | 2108 | <h4 data-i18n="InfermaticAI API Key">InfermaticAI API Key</h4> |
| 2109 | 2109 | <div class="flex-container"> |
| 2110 | 2110 | <input id="api_key_infermaticai" name="api_key_infermaticai" class="text_pole flex1" maxlength="500" value="" type="text" autocomplete="off"> |
| 2111 | 2111 | <div title="Clear your API key" data-i18n="[title]Clear your API key" class="menu_button fa-solid fa-circle-xmark clear-api-key" data-key="api_key_infermaticai"></div> |
| 2112 | 2112 | </div> |
| 2113 | 2113 | <div data-for="api_key_infermaticai" class="neutral_warning" data-i18n="For privacy reasons, your API key will be hidden after you reload the page."> |
| @@ -2130,7 +2130,7 @@ | ||
| 2130 | 2130 | </a> |
| 2131 | 2131 | </h4> |
| 2132 | 2132 | <div class="flex-container"> |
| 2133 | 2133 | <input id="api_key_dreamgen" name="api_key_dreamgen" class="text_pole flex1" maxlength="500" value="" type="text" autocomplete="off"> |
| 2134 | 2134 | <div title="Clear your API key" data-i18n="[title]Clear your API key" class="menu_button fa-solid fa-circle-xmark clear-api-key" data-key="api_key_dreamgen"></div> |
| 2135 | 2135 | </div> |
| 2136 | 2136 | <div data-for="api_key_dreamgen" class="neutral_warning" data-i18n="For privacy reasons, your API key will be hidden after you reload the page."> |
| @@ -2155,7 +2155,7 @@ | ||
| 2155 | 2155 | </a> |
| 2156 | 2156 | </h4> |
| 2157 | 2157 | <div class="flex-container"> |
| 2158 | 2158 | <input id="api_key_mancer" name="api_key_mancer" class="text_pole flex1 wide100p" maxlength="500" size="35" type="text" autocomplete="off"> |
| 2159 | 2159 | <div title="Clear your API key" data-i18n="[title]Clear your API key" class="menu_button fa-solid fa-circle-xmark clear-api-key" data-key="api_key_mancer"> |
| 2160 | 2160 | </div> |
| 2161 | 2161 | </div> |
| @@ -2185,7 +2185,7 @@ | ||
| 2185 | 2185 | </div> |
| 2186 | 2186 | <h4 data-i18n="API key (optional)">API key (optional)</h4> |
| 2187 | 2187 | <div class="flex-container"> |
| 2188 | 2188 | <input id="api_key_ooba" name="api_key_ooba" class="text_pole flex1 wide100p" maxlength="500" size="35" type="text" autocomplete="off"> |
| 2189 | 2189 | <div title="Clear your API key" data-i18n="[title]Clear your API key" class="menu_button fa-solid fa-circle-xmark clear-api-key" data-key="api_key_ooba"> |
| 2190 | 2190 | </div> |
| 2191 | 2191 | </div> |
| @@ -2195,9 +2195,9 @@ | ||
| 2195 | 2195 | <div class="flex1"> |
| 2196 | 2196 | <h4 data-i18n="Server url">Server URL</h4> |
| 2197 | 2197 | <small data-i18n="Example: 127.0.0.1:5000">Example: http://127.0.0.1:5000</small> |
| 2198 | 2198 | <input id="textgenerationwebui_api_url_text" name="textgenerationwebui_api_url" class="text_pole wide100p" maxlength="500" value="" autocomplete="off" data-server-history="ooba_blocking"> |
| 2199 | 2199 | </div> |
| 2200 | 2200 | <input id="custom_model_textgenerationwebui" class="text_pole wide100p" maxlength="500" placeholder="Custom model (optional)" data-i18n="[placeholder]Custom model (optional)" type="text"> |
| 2201 | 2201 | </div> |
| 2202 | 2202 | <div data-tg-type="featherless" class="flex-container flexFlowColumn"> |
| 2203 | 2203 | <div class="flex-container flexFlowColumn"> |
| @@ -2207,7 +2207,7 @@ | ||
| 2207 | 2207 | </div> |
| 2208 | 2208 | <h4 data-i18n="API key (optional)">API key</h4> |
| 2209 | 2209 | <div class="flex-container"> |
| 2210 | 2210 | <input id="api_key_featherless" name="api_key_featherless" class="text_pole flex1 wide100p" maxlength="500" size="35" type="text" autocomplete="off"> |
| 2211 | 2211 | <div title="Clear your API key" data-i18n="[title]Clear your API key" class="menu_button fa-solid fa-circle-xmark clear-api-key" data-key="api_key_featherless"> |
| 2212 | 2212 | </div> |
| 2213 | 2213 | </div> |
| @@ -2228,7 +2228,7 @@ | ||
| 2228 | 2228 | </div> |
| 2229 | 2229 | <h4 data-i18n="vLLM API key">vLLM API key</h4> |
| 2230 | 2230 | <div class="flex-container"> |
| 2231 | 2231 | <input id="api_key_vllm" name="api_key_vllm" class="text_pole flex1 wide100p" maxlength="500" size="35" type="text" autocomplete="off"> |
| 2232 | 2232 | <div title="Clear your API key" data-i18n="[title]Clear your API key" class="menu_button fa-solid fa-circle-xmark clear-api-key" data-key="api_key_vllm"> |
| 2233 | 2233 | </div> |
| 2234 | 2234 | </div> |
| @@ -2238,7 +2238,7 @@ | ||
| 2238 | 2238 | <div class="flex1"> |
| 2239 | 2239 | <h4 data-i18n="API url">API URL</h4> |
| 2240 | 2240 | <small data-i18n="Example: 127.0.0.1:8000">Example: http://127.0.0.1:8000</small> |
| 2241 | 2241 | <input id="vllm_api_url_text" class="text_pole wide100p" maxlength="500" value="" autocomplete="off" data-server-history="vllm"> |
| 2242 | 2242 | </div> |
| 2243 | 2243 | <div> |
| 2244 | 2244 | <h4 data-i18n="vLLM Model">vLLM Model</h4> |
| @@ -2252,7 +2252,7 @@ | ||
| 2252 | 2252 | <div data-tg-type="huggingface"> |
| 2253 | 2253 | <h4 data-i18n="HuggingFace Token">HuggingFace Token</h4> |
| 2254 | 2254 | <div class="flex-container"> |
| 2255 | 2255 | <input id="api_key_huggingface" name="api_key_huggingface" class="text_pole flex1 wide100p" maxlength="500" size="35" type="text" autocomplete="off"> |
| 2256 | 2256 | <div title="Clear your API key" data-i18n="[title]Clear your API key" class="menu_button fa-solid fa-circle-xmark clear-api-key" data-key="api_key_huggingface"> |
| 2257 | 2257 | </div> |
| 2258 | 2258 | </div> |
| @@ -2262,7 +2262,7 @@ | ||
| 2262 | 2262 | <div class="flex1"> |
| 2263 | 2263 | <h4 data-i18n="Endpoint URL">Endpoint URL</h4> |
| 2264 | 2264 | <small data-i18n="Example: https://****.endpoints.huggingface.cloud">Example: https://****.endpoints.huggingface.cloud</small> |
| 2265 | 2265 | <input id="huggingface_api_url_text" class="text_pole wide100p" maxlength="500" value="" autocomplete="off" data-server-history="huggingface"> |
| 2266 | 2266 | </div> |
| 2267 | 2267 | </div> |
| 2268 | 2268 | |
| @@ -2274,7 +2274,7 @@ | ||
| 2274 | 2274 | </div> |
| 2275 | 2275 | <h4 data-i18n="Aphrodite API key">Aphrodite API key</h4> |
| 2276 | 2276 | <div class="flex-container"> |
| 2277 | 2277 | <input id="api_key_aphrodite" name="api_key_aphrodite" class="text_pole flex1 wide100p" maxlength="500" size="35" type="text" autocomplete="off"> |
| 2278 | 2278 | <div title="Clear your API key" data-i18n="[title]Clear your API key" class="menu_button fa-solid fa-circle-xmark clear-api-key" data-key="api_key_aphrodite"> |
| 2279 | 2279 | </div> |
| 2280 | 2280 | </div> |
| @@ -2284,7 +2284,7 @@ | ||
| 2284 | 2284 | <div class="flex1"> |
| 2285 | 2285 | <h4 data-i18n="API url">API URL</h4> |
| 2286 | 2286 | <small data-i18n="Example: 127.0.0.1:5000">Example: http://127.0.0.1:5000</small> |
| 2287 | 2287 | <input id="aphrodite_api_url_text" class="text_pole wide100p" maxlength="500" value="" autocomplete="off" data-server-history="aphrodite"> |
| 2288 | 2288 | </div> |
| 2289 | 2289 | <div> |
| 2290 | 2290 | <h4 data-i18n="Aphrodite Model">Aphrodite Model</h4> |
| @@ -2303,7 +2303,7 @@ | ||
| 2303 | 2303 | </div> |
| 2304 | 2304 | <h4 data-i18n="API key (optional)">API key (optional)</h4> |
| 2305 | 2305 | <div class="flex-container"> |
| 2306 | 2306 | <input id="api_key_llamacpp" name="api_key_llamacpp" class="text_pole flex1 wide100p" maxlength="500" size="35" type="text" autocomplete="off"> |
| 2307 | 2307 | <div title="Clear your API key" data-i18n="[title]Clear your API key" class="menu_button fa-solid fa-circle-xmark clear-api-key" data-key="api_key_llamacpp"> |
| 2308 | 2308 | </div> |
| 2309 | 2309 | </div> |
| @@ -2313,7 +2313,7 @@ | ||
| 2313 | 2313 | <div class="flex1"> |
| 2314 | 2314 | <h4 data-i18n="API url">API URL</h4> |
| 2315 | 2315 | <small data-i18n="Example: 127.0.0.1:8080">Example: http://127.0.0.1:8080</small> |
| 2316 | 2316 | <input id="llamacpp_api_url_text" class="text_pole wide100p" maxlength="500" value="" autocomplete="off" data-server-history="llamacpp"> |
| 2317 | 2317 | </div> |
| 2318 | 2318 | </div> |
| 2319 | 2319 | <div data-tg-type="ollama"> |
| @@ -2325,7 +2325,7 @@ | ||
| 2325 | 2325 | <div class="flex1"> |
| 2326 | 2326 | <h4 data-i18n="API url">API URL</h4> |
| 2327 | 2327 | <small data-i18n="Example: 127.0.0.1:11434">Example: http://127.0.0.1:11434</small> |
| 2328 | 2328 | <input id="ollama_api_url_text" class="text_pole wide100p" maxlength="500" value="" autocomplete="off" data-server-history="ollama"> |
| 2329 | 2329 | </div> |
| 2330 | 2330 | <div class="flex1"> |
| 2331 | 2331 | <h4> |
| @@ -2351,7 +2351,7 @@ | ||
| 2351 | 2351 | </div> |
| 2352 | 2352 | <h4 data-i18n="Tabby API key">Tabby API key</h4> |
| 2353 | 2353 | <div class="flex-container"> |
| 2354 | 2354 | <input id="api_key_tabby" name="api_key_tabby" class="text_pole flex1 wide100p" maxlength="500" size="35" type="text" autocomplete="off"> |
| 2355 | 2355 | <div title="Clear your API key" data-i18n="[title]Clear your API key" class="menu_button fa-solid fa-circle-xmark clear-api-key" data-key="api_key_tabby"> |
| 2356 | 2356 | </div> |
| 2357 | 2357 | </div> |
| @@ -2361,7 +2361,7 @@ | ||
| 2361 | 2361 | <div class="flex1"> |
| 2362 | 2362 | <h4 data-i18n="API url">API URL</h4> |
| 2363 | 2363 | <small data-i18n="Example: 127.0.0.1:5000">Example: http://127.0.0.1:5000</small> |
| 2364 | 2364 | <input id="tabby_api_url_text" class="text_pole wide100p" maxlength="500" value="" autocomplete="off" data-server-history="tabby"> |
| 2365 | 2365 | </div> |
| 2366 | 2366 | <div class="flex1"> |
| 2367 | 2367 | <h4> |
| @@ -2382,7 +2382,7 @@ | ||
| 2382 | 2382 | </div> |
| 2383 | 2383 | <h4 data-i18n="koboldcpp API key (optional)">koboldcpp API key (optional)</h4> |
| 2384 | 2384 | <div class="flex-container"> |
| 2385 | 2385 | <input id="api_key_koboldcpp" name="api_key_koboldcpp" class="text_pole flex1 wide100p" maxlength="500" size="35" type="text" autocomplete="off"> |
| 2386 | 2386 | <div title="Clear your API key" data-i18n="[title]Clear your API key" class="menu_button fa-solid fa-circle-xmark clear-api-key" data-key="api_key_koboldcpp"> |
| 2387 | 2387 | </div> |
| 2388 | 2388 | </div> |
| @@ -2392,7 +2392,7 @@ | ||
| 2392 | 2392 | <div class="flex1"> |
| 2393 | 2393 | <h4 data-i18n="API url">API URL</h4> |
| 2394 | 2394 | <small data-i18n="Example: 127.0.0.1:5001">Example: http://127.0.0.1:5001</small> |
| 2395 | 2395 | <input id="koboldcpp_api_url_text" class="text_pole wide100p" maxlength="500" value="" autocomplete="off" data-server-history="koboldcpp"> |
| 2396 | 2396 | </div> |
| 2397 | 2397 | </div> |
| 2398 | 2398 | <div class="flex-container"> |
| @@ -2467,7 +2467,7 @@ | ||
| 2467 | 2467 | </span> |
| 2468 | 2468 | </div> |
| 2469 | 2469 | <div class="wide100p"> |
| 2470 | 2470 | <input id="openai_reverse_proxy_name" type="text" class="text_pole" placeholder="..." maxlength="100" /> |
| 2471 | 2471 | </div> |
| 2472 | 2472 | <div class="range-block-title justifyLeft" data-i18n="Proxy Server URL"> |
| 2473 | 2473 | Proxy Server URL |
| @@ -2478,7 +2478,7 @@ | ||
| 2478 | 2478 | </span> |
| 2479 | 2479 | </div> |
| 2480 | 2480 | <div class="wide100p"> |
| 2481 | 2481 | <input id="openai_reverse_proxy" type="text" class="text_pole" placeholder="https://api.openai.com/v1" maxlength="5000" /> |
| 2482 | 2482 | <small class="reverse_proxy_warning"> |
| 2483 | 2483 | <span data-i18n="Doesn't work? Try adding">Doesn't work? Try adding</span> <code>/v1</code> <span data-i18n="at the end!">at the end!</span> |
| 2484 | 2484 | </small> |
| @@ -2492,7 +2492,7 @@ | ||
| 2492 | 2492 | </span> |
| 2493 | 2493 | </div> |
| 2494 | 2494 | <div class="flex-container width100p"> |
| 2495 | 2495 | <input id="openai_proxy_password" type="password" class="text_pole flex1" placeholder="" maxlength="5000" form="openai_form" autocomplete="off" /> |
| 2496 | 2496 | <div id="openai_proxy_password_show" title="Peek a password" data-i18n="[title]Peek a password" class="menu_button fa-solid fa-eye-slash fa-fw"></div> |
| 2497 | 2497 | </div> |
| 2498 | 2498 | </div> |
| @@ -2533,7 +2533,7 @@ | ||
| 2533 | 2533 | </ol> |
| 2534 | 2534 | </span> |
| 2535 | 2535 | <div class="flex-container"> |
| 2536 | 2536 | <input id="api_key_openai" name="api_key_openai" class="text_pole flex1" maxlength="500" value="" type="text" autocomplete="off"> |
| 2537 | 2537 | <div title="Clear your API key" data-i18n="[title]Clear your API key" class="menu_button fa-solid fa-circle-xmark clear-api-key" data-key="api_key_openai"></div> |
| 2538 | 2538 | </div> |
| 2539 | 2539 | <div id="ReverseProxyWarningMessage2" class="reverse_proxy_warning"> |
| @@ -2618,7 +2618,7 @@ | ||
| 2618 | 2618 | </b> |
| 2619 | 2619 | </div> |
| 2620 | 2620 | <div class="flex-container"> |
| 2621 | 2621 | <input id="api_key_claude" name="api_key_claude" class="text_pole flex1" maxlength="500" value="" type="text" autocomplete="off"> |
| 2622 | 2622 | <div title="Clear your API key" data-i18n="[title]Clear your API key" class="menu_button fa-solid fa-circle-xmark clear-api-key" data-key="api_key_claude"></div> |
| 2623 | 2623 | </div> |
| 2624 | 2624 | <div data-for="api_key_claude" class="neutral_warning" data-i18n="For privacy reasons, your API key will be hidden after you reload the page."> |
| @@ -2670,7 +2670,7 @@ | ||
| 2670 | 2670 | <a href="https://openrouter.ai/account" target="_blank" data-i18n="View Remaining Credits">View Remaining Credits</a> |
| 2671 | 2671 | </div> |
| 2672 | 2672 | <div class="flex-container"> |
| 2673 | 2673 | <input id="api_key_openrouter" name="api_key_openrouter" class="text_pole flex1 api_key_openrouter" maxlength="500" value="" type="text" autocomplete="off"> |
| 2674 | 2674 | <div title="Clear your API key" data-i18n="[title]Clear your API key" class="menu_button fa-solid fa-circle-xmark clear-api-key" data-key="api_key_openrouter"></div> |
| 2675 | 2675 | </div> |
| 2676 | 2676 | <div data-for="api_key_openrouter" class="neutral_warning" data-i18n="For privacy reasons, your API key will be hidden after you reload the page."> |
| @@ -2746,19 +2746,19 @@ | ||
| 2746 | 2746 | <div id="normal_scale_form"> |
| 2747 | 2747 | <h4 data-i18n="Scale API Key">Scale API Key</h4> |
| 2748 | 2748 | <div class="flex-container"> |
| 2749 | 2749 | <input id="api_key_scale" name="api_key_scale" class="text_pole flex1" maxlength="500" value="" autocomplete="off"> |
| 2750 | 2750 | <div title="Clear your API key" data-i18n="[title]Clear your API key" class="menu_button fa-solid fa-circle-xmark clear-api-key" data-key="api_key_scale"></div> |
| 2751 | 2751 | </div> |
| 2752 | 2752 | <div data-for="api_key_scale" class="neutral_warning" data-i18n="For privacy reasons, your API key will be hidden after you reload the page."> |
| 2753 | 2753 | For privacy reasons, your API key will be hidden after you reload the page. |
| 2754 | 2754 | </div> |
| 2755 | 2755 | <h4>Scale API URL</h4> |
| 2756 | 2756 | <input id="api_url_scale" name="api_url_scale" class="text_pole" maxlength="500" value="" autocomplete="off" placeholder="https://dashboard.scale.com/spellbook/api/v2/deploy/xxxxxxx"> |
| 2757 | 2757 | </div> |
| 2758 | 2758 | <div id="alt_scale_form"> |
| 2759 | 2759 | <h4>Scale Cookie (_jwt)</h4> |
| 2760 | 2760 | <div class="flex-container"> |
| 2761 | 2761 | <input id="scale_cookie" name="scale_cookie" class="text_pole flex1" maxlength="500" value="" autocomplete="off"> |
| 2762 | 2762 | <div title="Clear your cookie" data-i18n="[title]Clear your cookie" class="menu_button fa-solid fa-circle-xmark clear-api-key" data-key="scale_cookie"></div> |
| 2763 | 2763 | </div> |
| 2764 | 2764 | <div data-for="scale_cookie" class="neutral_warning"> |
| @@ -2775,7 +2775,7 @@ | ||
| 2775 | 2775 | <form id="ai21_form" data-source="ai21" action="javascript:void(null);" method="post" enctype="multipart/form-data"> |
| 2776 | 2776 | <h4 data-i18n="AI21 API Key">AI21 API Key</h4> |
| 2777 | 2777 | <div class="flex-container"> |
| 2778 | 2778 | <input id="api_key_ai21" name="api_key_ai21" class="text_pole flex1" maxlength="500" value="" type="text" autocomplete="off"> |
| 2779 | 2779 | <div title="Clear your API key" data-i18n="[title]Clear your API key" class="menu_button fa-solid fa-circle-xmark clear-api-key" data-key="api_key_ai21"></div> |
| 2780 | 2780 | </div> |
| 2781 | 2781 | <div data-for="api_key_ai21" class="neutral_warning" data-i18n="For privacy reasons, your API key will be hidden after you reload the page."> |
| @@ -2797,7 +2797,7 @@ | ||
| 2797 | 2797 | <form id="makersuite_form" data-source="makersuite" action="javascript:void(null);" method="post" enctype="multipart/form-data"> |
| 2798 | 2798 | <h4 data-i18n="Google AI Studio API Key">Google AI Studio API Key</h4> |
| 2799 | 2799 | <div class="flex-container"> |
| 2800 | 2800 | <input id="api_key_makersuite" name="api_key_makersuite" class="text_pole flex1" maxlength="500" value="" type="text" autocomplete="off"> |
| 2801 | 2801 | <div title="Clear your API key" data-i18n="[title]Clear your API key" class="menu_button fa-solid fa-circle-xmark clear-api-key" data-key="api_key_makersuite"></div> |
| 2802 | 2802 | </div> |
| 2803 | 2803 | <div data-for="api_key_makersuite" class="neutral_warning" data-i18n="For privacy reasons, your API key will be hidden after you reload the page."> |
| @@ -2836,7 +2836,7 @@ | ||
| 2836 | 2836 | <form id="mistralai_form" data-source="mistralai" action="javascript:void(null);" method="post" enctype="multipart/form-data"> |
| 2837 | 2837 | <h4 data-i18n="MistralAI API Key">MistralAI API Key</h4> |
| 2838 | 2838 | <div class="flex-container"> |
| 2839 | 2839 | <input id="api_key_mistralai" name="api_key_mistralai" class="text_pole flex1" maxlength="500" value="" type="text" autocomplete="off"> |
| 2840 | 2840 | <div title="Clear your API key" data-i18n="[title]Clear your API key" class="menu_button fa-solid fa-circle-xmark clear-api-key" data-key="api_key_mistralai"></div> |
| 2841 | 2841 | </div> |
| 2842 | 2842 | <div data-for="api_key_mistralai" class="neutral_warning" data-i18n="For privacy reasons, your API key will be hidden after you reload the page."> |
| @@ -2875,7 +2875,7 @@ | ||
| 2875 | 2875 | <div id="groq_form" data-source="groq"> |
| 2876 | 2876 | <h4 data-i18n="Groq API Key">Groq API Key</h4> |
| 2877 | 2877 | <div class="flex-container"> |
| 2878 | 2878 | <input id="api_key_groq" name="api_key_groq" class="text_pole flex1" maxlength="500" value="" type="text" autocomplete="off"> |
| 2879 | 2879 | <div title="Clear your API key" data-i18n="[title]Clear your API key" class="menu_button fa-solid fa-circle-xmark clear-api-key" data-key="api_key_groq"></div> |
| 2880 | 2880 | </div> |
| 2881 | 2881 | <div data-for="api_key_groq" class="neutral_warning" data-i18n="For privacy reasons, your API key will be hidden after you reload the page."> |
| @@ -2898,7 +2898,7 @@ | ||
| 2898 | 2898 | <div id="perplexity_form" data-source="perplexity"> |
| 2899 | 2899 | <h4 data-i18n="Perplexity API Key">Perplexity API Key</h4> |
| 2900 | 2900 | <div class="flex-container"> |
| 2901 | 2901 | <input id="api_key_perplexity" name="api_key_perplexity" class="text_pole flex1" maxlength="500" value="" type="text" autocomplete="off"> |
| 2902 | 2902 | <div title="Clear your API key" data-i18n="[title]Clear your API key" class="menu_button fa-solid fa-circle-xmark clear-api-key" data-key="api_key_perplexity"></div> |
| 2903 | 2903 | </div> |
| 2904 | 2904 | <div data-for="api_key_perplexity" class="neutral_warning" data-i18n="For privacy reasons, your API key will be hidden after you reload the page."> |
| @@ -2938,7 +2938,7 @@ | ||
| 2938 | 2938 | <form id="cohere_form" data-source="cohere" action="javascript:void(null);" method="post" enctype="multipart/form-data"> |
| 2939 | 2939 | <h4 data-i18n="Cohere API Key">Cohere API Key</h4> |
| 2940 | 2940 | <div class="flex-container"> |
| 2941 | 2941 | <input id="api_key_cohere" name="api_key_cohere" class="text_pole flex1" maxlength="500" value="" type="text" autocomplete="off"> |
| 2942 | 2942 | <div title="Clear your API key" data-i18n="[title]Clear your API key" class="menu_button fa-solid fa-circle-xmark clear-api-key" data-key="api_key_cohere"></div> |
| 2943 | 2943 | </div> |
| 2944 | 2944 | <div data-for="api_key_cohere" class="neutral_warning" data-i18n="For privacy reasons, your API key will be hidden after you reload the page."> |
| @@ -2966,7 +2966,7 @@ | ||
| 2966 | 2966 | <form id="blockentropy_form" data-source="blockentropy"> |
| 2967 | 2967 | <h4 data-i18n="Block Entropy API Key">Block Entropy API Key</h4> |
| 2968 | 2968 | <div class="flex-container"> |
| 2969 | 2969 | <input id="api_key_blockentropy" name="api_key_blockentropy" class="text_pole flex1" maxlength="500" value="" type="text" autocomplete="off"> |
| 2970 | 2970 | <div title="Clear your API key" data-i18n="[title]Clear your API key" class="menu_button fa-solid fa-circle-xmark clear-api-key" data-key="api_key_blockentropy"></div> |
| 2971 | 2971 | </div> |
| 2972 | 2972 | <div data-for="api_key_blockentropy" class="neutral_warning" data-i18n="For privacy reasons, your API key will be hidden after you reload the page."> |
| @@ -2980,7 +2980,7 @@ | ||
| 2980 | 2980 | <form id="custom_form" data-source="custom"> |
| 2981 | 2981 | <h4 data-i18n="Custom Endpoint (Base URL)">Custom Endpoint (Base URL)</h4> |
| 2982 | 2982 | <div class="flex-container"> |
| 2983 | 2983 | <input id="custom_api_url_text" class="text_pole wide100p" maxlength="5000" value="" autocomplete="off" data-i18n="[placeholder]Example: http://localhost:1234/v1" placeholder="Example: http://localhost:1234/v1"> |
| 2984 | 2984 | </div> |
| 2985 | 2985 | <div> |
| 2986 | 2986 | <small> |
| @@ -2992,7 +2992,7 @@ | ||
| 2992 | 2992 | <small data-i18n="(Optional)">(Optional)</small> |
| 2993 | 2993 | </h4> |
| 2994 | 2994 | <div class="flex-container"> |
| 2995 | 2995 | <input id="api_key_custom" name="api_key_custom" class="text_pole flex1" maxlength="5000" value="" type="text" autocomplete="off"> |
| 2996 | 2996 | <div title="Clear your API key" data-i18n="[title]Clear your API key" class="menu_button fa-solid fa-circle-xmark clear-api-key" data-key="api_key_custom"></div> |
| 2997 | 2997 | </div> |
| 2998 | 2998 | <div data-for="api_key_custom" class="neutral_warning" data-i18n="For privacy reasons, your API key will be hidden after you reload the page."> |
| @@ -3000,7 +3000,7 @@ | ||
| 3000 | 3000 | </div> |
| 3001 | 3001 | <h4 data-i18n="Enter a Model ID">Enter a Model ID</h4> |
| 3002 | 3002 | <div class="flex-container"> |
| 3003 | 3003 | <input list="model_custom_select_fill" id="custom_model_id" class="text_pole wide100p" maxlength="500" value="" autocomplete="off" data-i18n="[placeholder]Example: gpt-3.5-turbo" placeholder="Example: gpt-3.5-turbo"> |
| 3004 | 3004 | <datalist id="model_custom_select_fill" class="text_pole model_custom_select"></datalist> |
| 3005 | 3005 | </div> |
| 3006 | 3006 | <h4 data-i18n="Available Models">Available Models</h4> |
| @@ -3020,7 +3020,7 @@ | ||
| 3020 | 3020 | </a> |
| 3021 | 3021 | </h4> |
| 3022 | 3022 | <div class="flex-container"> |
| 3023 | 3023 | <input id="api_key_01ai" name="api_key_01ai" class="text_pole flex1" maxlength="500" value="" type="text" autocomplete="off"> |
| 3024 | 3024 | <div title="Clear your API key" data-i18n="[title]Clear your API key" class="menu_button fa-solid fa-circle-xmark clear-api-key" data-key="api_key_01ai"></div> |
| 3025 | 3025 | </div> |
| 3026 | 3026 | <div data-for="api_key_01ai" class="neutral_warning" data-i18n="For privacy reasons, your API key will be hidden after you reload the page."> |
| @@ -3059,8 +3059,8 @@ | ||
| 3059 | 3059 | <h3 class="margin0" data-i18n="Advanced Formatting"> |
| 3060 | 3060 | Advanced Formatting |
| 3061 | 3061 | </h3> |
| 3062 | 3062 | <div class="flex-container spaceEvenly"> |
| 3063 | 3063 | <div id="PygOverridesContextSettings" class="flex-container flexNoGap flexFlowColumn flex1"> |
| 3064 | 3064 | <div> |
| 3065 | 3065 | <h4 class="standoutHeader title_restorable"> |
| 3066 | 3066 | <div> |
| @@ -3069,32 +3069,32 @@ | ||
| 3069 | 3069 | <span class="fa-solid fa-circle-question note-link-span"></span> |
| 3070 | 3070 | </a> |
| 3071 | 3071 | </div> |
| 3072 | - <div class="flex-container"> | |
| 3073 | - <i data-newbie-hidden data-preset-manager-import="context" class="margin0 menu_button fa-solid fa-file-import" title="Import preset" data-i18n="[title]Import preset"></i> | |
| 3074 | - <i data-newbie-hidden data-preset-manager-export="context" class="margin0 menu_button fa-solid fa-file-export" title="Export preset" data-i18n="[title]Export preset"></i> | |
| 3075 | - <i data-newbie-hidden data-preset-manager-restore="context" class="margin0 menu_button fa-solid fa-recycle" title="Restore current preset" data-i18n="[title]Restore current preset"></i> | |
| 3076 | - <i data-newbie-hidden id="context_delete_preset" data-preset-manager-delete="context" class="margin0 menu_button fa-solid fa-trash-can" title="Delete the preset" data-i18n="[title]Delete the preset"></i> | |
| 3077 | - </div> | |
| 3078 | 3072 | </h4> |
| 3079 | 3073 | <div class="flex-container justifyCenter"> |
| 3080 | - <select id="context_presets" data-preset-manager-for="context" class="flex1 text_pole"></select> | |
| 3081 | 3074 | <input type="file" hidden data-preset-manager-file="context" accept=".json, .settings"> |
| 3082 | 3075 | <i id="context_set_default" class="menu_button fa-solid fa-heart" title="Auto-select this preset for Instruct Mode." data-i18n="[title]Auto-select this preset for Instruct Mode"></i> |
| 3083 | 3076 | <i data-newbie-hidden data-preset-manager-update="context" class="menu_button fa-solid fa-save" title="Update current preset" data-i18n="[title]Update current preset"></i> |
| 3084 | 3077 | <i data-newbie-hidden data-preset-manager-new="context" class="menu_button fa-solid fa-file-circle-plus" title="Save preset as" data-i18n="[title]Save preset as"></i> |
| 3078 | + <i data-preset-manager-import="context" class="menu_button fa-solid fa-file-import" title="Import preset" data-i18n="[title]Import preset"></i> | |
| 3079 | + <i data-preset-manager-export="context" class="menu_button fa-solid fa-file-export" title="Export preset" data-i18n="[title]Export preset"></i> | |
| 3080 | + <i data-newbie-hidden data-preset-manager-restore="context" class="menu_button fa-solid fa-recycle" title="Restore current preset" data-i18n="[title]Restore current preset"></i> | |
| 3081 | + <i id="context_delete_preset" data-preset-manager-delete="context" class="menu_button fa-solid fa-trash-can" title="Delete the preset" data-i18n="[title]Delete the preset"></i> | |
| 3082 | + </div> | |
| 3083 | + <div class="flex-container"> | |
| 3084 | + <select id="context_presets" data-preset-manager-for="context" class="flex1 text_pole"></select> | |
| 3085 | 3085 | </div> |
| 3086 | 3086 | <div data-newbie-hidden> |
| 3087 | 3087 | <label for="context_story_string"> |
| 3088 | 3088 | <small data-i18n="Story String">Story String</small> |
| 3089 | 3089 | </label> |
| 3090 | 3090 | <textareadiv contenteditable="true" id="context_story_string" class="text_pole textarea_compact autoSetHeight" rows="1"></textareadiv> |
| 3091 | 3091 | <div class="flex-container"> |
| 3092 | 3092 | <div class="flex1"> |
| 3093 | 3093 | <label for="context_example_separator"> |
| 3094 | 3094 | <small data-i18n="Example Separator">Example Separator</small> |
| 3095 | 3095 | </label> |
| 3096 | 3096 | <div> |
| 3097 | 3097 | <textareadiv contenteditable="true" id="context_example_separator" class="text_pole textarea_compact autoSetHeight" maxlength="500" rows="1"></textareadiv> |
| 3098 | 3098 | </div> |
| 3099 | 3099 | </div> |
| 3100 | 3100 | <div class="flex1"> |
| @@ -3102,10 +3102,53 @@ | ||
| 3102 | 3102 | <small data-i18n="Chat Start">Chat Start</small> |
| 3103 | 3103 | </label> |
| 3104 | 3104 | <div> |
| 3105 | 3105 | <textareadiv contenteditable="true" id="context_chat_start" class="text_pole textarea_compact autoSetHeight" maxlength="500" rows="1"></textareadiv> |
| 3106 | 3106 | </div> |
| 3107 | 3107 | </div> |
| 3108 | 3108 | </div> |
| 3109 | + <div> | |
| 3110 | + <h4 class="standoutHeader"> | |
| 3111 | + <span data-i18n="Context Formatting"> | |
| 3112 | + Context Formatting | |
| 3113 | + </span> | |
| 3114 | + <small data-i18n="(Saves to Template)"> | |
| 3115 | + (Saves to Template) | |
| 3116 | + </small> | |
| 3117 | + </h4> | |
| 3118 | + | |
| 3119 | + <label class="checkbox_label" for="always-force-name2-checkbox"> | |
| 3120 | + <input id="always-force-name2-checkbox" type="checkbox" /> | |
| 3121 | + <small data-i18n="Always add character's name to prompt"> | |
| 3122 | + Always add character's name to prompt | |
| 3123 | + </small> | |
| 3124 | + </label> | |
| 3125 | + <label class="checkbox_label" for="single_line"> | |
| 3126 | + <input id="single_line" type="checkbox" /> | |
| 3127 | + <small data-i18n="Generate only one line per request"> | |
| 3128 | + Generate only one line per request | |
| 3129 | + </small> | |
| 3130 | + </label> | |
| 3131 | + <label class="checkbox_label" for="collapse-newlines-checkbox"> | |
| 3132 | + <input id="collapse-newlines-checkbox" type="checkbox" /> | |
| 3133 | + <small data-i18n="Collapse Consecutive Newlines"> | |
| 3134 | + Collapse Consecutive Newlines | |
| 3135 | + </small> | |
| 3136 | + </label> | |
| 3137 | + <label data-newbie-hidden class="checkbox_label" for="trim_spaces"> | |
| 3138 | + <input id="trim_spaces" type="checkbox" /> | |
| 3139 | + <small data-i18n="Trim spaces">Trim spaces</small> | |
| 3140 | + </label> | |
| 3141 | + <label class="checkbox_label" for="trim_sentences_checkbox"> | |
| 3142 | + <input id="trim_sentences_checkbox" type="checkbox" /> | |
| 3143 | + <small data-i18n="Trim Incomplete Sentences"> | |
| 3144 | + Trim Incomplete Sentences | |
| 3145 | + </small> | |
| 3146 | + </label> | |
| 3147 | + <!-- Add margin since this is a child of above --> | |
| 3148 | + <label data-newbie-hidden class="checkbox_label indent20p" for="include_newline_checkbox"> | |
| 3149 | + <input id="include_newline_checkbox" type="checkbox" /> | |
| 3150 | + <small data-i18n="Include Newline">Include Newline</small> | |
| 3151 | + </label> | |
| 3109 | 3152 | <label class="checkbox_label" title="Add Chat Start and Example Separator to a list of stopping strings." data-i18n="[title]Add Chat Start and Example Separator to a list of stopping strings."> |
| 3110 | 3153 | <input id="context_use_stop_strings" type="checkbox" /> |
| 3111 | 3154 | <small data-i18n="Separators as Stop Strings">Separators as Stop Strings</small> |
| @@ -3114,201 +3157,238 @@ | ||
| 3114 | 3157 | <input id="context_names_as_stop_strings" type="checkbox" /> |
| 3115 | 3158 | <small data-i18n="Names as Stop Strings">Names as Stop Strings</small> |
| 3116 | 3159 | </label> |
| 3160 | + </div> | |
| 3161 | + | |
| 3117 | 3162 | <label class="checkbox_label" title="Includes Post-History Instructions at the end of the prompt, if defined in the character card AND ''Prefer Char. Instructions'' is enabled. THIS IS NOT RECOMMENDED FOR TEXT COMPLETION MODELS, CAN LEAD TO BAD OUTPUT." data-i18n="[title]context_allow_post_history_instructions"> |
| 3118 | 3163 | <input id="context_allow_jailbreak" type="checkbox" /> |
| 3119 | 3164 | <small data-i18n="Allow Post-History Instructions">Allow Post-History Instructions</small> |
| 3120 | 3165 | </label> |
| 3121 | 3166 | </div> |
| 3122 | - | |
| 3167 | + <div> | |
| 3123 | - <div data-newbie-hidden class="inline-drawer wide100p flexFlowColumn margin-bot-10px" style="display:none;"> | |
| 3168 | + <h4 class="range-block-title justifyLeft standoutHeader"> | |
| 3124 | - <div class="inline-drawer-toggle inline-drawer-header"> | |
| 3169 | + <span data-i18n="Custom Stopping Strings"> | |
| 3125 | - <b><span data-i18n="Context Order">Context Order</span></b> | |
| 3170 | + Custom Stopping Strings | |
| 3126 | - <div class="fa-solid fa-circle-chevron-down inline-drawer-icon down"></div> | |
| 3171 | + </span> | |
| 3127 | - </div> | |
| 3172 | + <a href="https://docs.sillytavern.app/usage/core-concepts/advancedformatting/#custom-stopping-strings" class="notes-link" target="_blank"> | |
| 3128 | - <div class="inline-drawer-content"> | |
| 3173 | + <span class="fa-solid fa-circle-question note-link-span"></span> | |
| 3129 | - <div id="context_order" class="prompt_order"> | |
| 3174 | + </a> | |
| 3130 | - <div data-id="0"> | |
| 3175 | + </h4> | |
| 3131 | - <span data-i18n="Story String">Story String</span> | |
| 3176 | + <div> | |
| 3132 | - <small>0</small> | |
| 3177 | + <small> | |
| 3133 | - </div> | |
| 3178 | + <span data-i18n="JSON serialized array of strings">JSON serialized array of strings</span> | |
| 3134 | - <div data-id="1"> | |
| 3179 | + <i class="fa-solid fa-question-circle opacity50p" title="e.g: ["Ford", "BMW", "Fiat"]"></i> | |
| 3135 | - <span data-i18n="Summary">Summary</span> | |
| 3180 | + </small> | |
| 3136 | - <small>1</small> | |
| 3137 | - </div> | |
| 3138 | - <div data-id="2"> | |
| 3139 | - <span data-i18n="Author's Note">Author's Note</span> | |
| 3140 | - <small>2</small> | |
| 3141 | - </div> | |
| 3142 | - <div data-id="3"> | |
| 3143 | - <span data-i18n="Example Dialogues">Example Dialogues</span> | |
| 3144 | - <small>3</small> | |
| 3145 | - </div> | |
| 3146 | - <div data-id="4"> | |
| 3147 | - <span data-i18n="Chat Start">Chat History</span> | |
| 3148 | - <small>4</small> | |
| 3149 | 3181 | </div> |
| 3182 | + <div> | |
| 3183 | + <div contenteditable="true" id="custom_stopping_strings" class="text_pole textarea_compact monospace"></div> | |
| 3150 | 3184 | </div> |
| 3151 | - <small> | |
| 3185 | + <label class="checkbox_label" for="custom_stopping_strings_macro"> | |
| 3152 | - <b data-i18n="Hint">Hint:</b> | |
| 3186 | + <input id="custom_stopping_strings_macro" type="checkbox" checked> | |
| 3153 | 3187 | <spansmall data-i18n="In-ChatReplace PositionMacro notin affectedCustom Stopping Strings"> |
| 3154 | - Summary and Author's Note orders are only affected when they don't have an In-Chat position set. | |
| 3188 | + Replace Macro in Custom Stopping Strings | |
| 3155 | - </span> | |
| 3156 | 3189 | </small> |
| 3190 | + </label> | |
| 3157 | 3191 | </div> |
| 3158 | 3192 | </div> |
| 3159 | 3193 | </div> |
| 3160 | - <div> | |
| 3194 | + <div id="InstructSettingsColumn" class="flex-container flexNoGap flexFlowColumn flex1"> | |
| 3161 | 3195 | <h4div classid="standoutHeader title_restorableinstructSettingsBlock"> |
| 3162 | - <div> | |
| 3196 | + <h4 class="standoutHeader title_restorable justifySpaceBetween"> | |
| 3197 | + <div class="flex-container"> | |
| 3163 | 3198 | <span data-i18n="Instruct Mode">Instruct Mode</span> |
| 3164 | 3199 | <a href="https://docs.sillytavern.app/usage/core-concepts/instructmode/" class="notes-link" target="_blank"> |
| 3165 | 3200 | <span class="fa-solid fa-circle-question note-link-span"></span> |
| 3166 | 3201 | </a> |
| 3167 | 3202 | </div> |
| 3168 | 3203 | <div class="flex-container"> |
| 3169 | - <i data-newbie-hidden data-preset-manager-import="instruct" class="margin0 menu_button fa-solid fa-file-import" title="Import preset" data-i18n="[title]Import preset"></i> | |
| 3170 | - <i data-newbie-hidden data-preset-manager-export="instruct" class="margin0 menu_button fa-solid fa-file-export" title="Export preset" data-i18n="[title]Export preset"></i> | |
| 3171 | - <i data-newbie-hidden data-preset-manager-restore="instruct" class="margin0 menu_button fa-solid fa-recycle" title="Restore current preset" data-i18n="[title]Restore current preset"></i> | |
| 3172 | - <i data-newbie-hidden data-preset-manager-delete="instruct" class="margin0 menu_button fa-solid fa-trash-can" title="Delete the preset" data-i18n="[title]Delete the preset"></i> | |
| 3173 | - </div> | |
| 3174 | - </h4> | |
| 3175 | - <div class="flex-container"> | |
| 3176 | 3204 | <label for="instruct_enabled" class="checkbox_label flex1"> |
| 3177 | 3205 | <input id="instruct_enabled" type="checkbox" style="display:none;" /> |
| 3178 | - <span data-i18n="Enabled">Enabled</span> | |
| 3206 | + <small><i class="fa-solid fa-power-off menu_button margin0"></i></small> | |
| 3179 | 3207 | </label> |
| 3180 | 3208 | <label for="instruct_bind_to_context" class="checkbox_label flex1" title="If enabled, Context templates will be automatically selected based on selected Instruct template name or by preference." data-i18n="[title]instruct_bind_to_context"> |
| 3181 | 3209 | <input id="instruct_bind_to_context" type="checkbox" style="display:none;" /> |
| 3182 | - <span data-i18n="Bind to Context">Bind to Context</span> | |
| 3210 | + <small><i class="fa-solid fa-link menu_button margin0" title="If enabled, Context templates will be automatically selected based on selected Instruct template name or by preference."></i></small> | |
| 3183 | 3211 | </label> |
| 3184 | 3212 | </div> |
| 3185 | - <label for="instruct_presets"> | |
| 3213 | + </h4> | |
| 3186 | - <span data-i18n="Presets">Presets</span> | |
| 3214 | + <div class="flex-container margin0 justifyCenter"> | |
| 3187 | - </label> | |
| 3188 | - <div class="flex-container"> | |
| 3189 | - <select id="instruct_presets" data-preset-manager-for="instruct" class="flex1 text_pole"></select> | |
| 3190 | 3215 | <input type="file" hidden data-preset-manager-file="instruct" accept=".json, .settings"> |
| 3191 | 3216 | <i id="instruct_set_default" class="menu_button fa-solid fa-heart" title="Auto-select this preset on API connection." data-i18n="[title]Auto-select this preset on API connection"></i> |
| 3192 | 3217 | <i data-newbie-hidden data-preset-manager-update="instruct" class="menu_button fa-solid fa-save" title="Update current preset" data-i18n="[title]Update current preset"></i> |
| 3193 | 3218 | <i data-newbie-hidden data-preset-manager-new="instruct" class="menu_button fa-solid fa-file-circle-plus" title="Save preset as" data-i18n="[title]Save preset as"></i> |
| 3219 | + <i data-preset-manager-import="instruct" class=" menu_button fa-solid fa-file-import" title="Import preset" data-i18n="[title]Import preset"></i> | |
| 3220 | + <i data-preset-manager-export="instruct" class=" menu_button fa-solid fa-file-export" title="Export preset" data-i18n="[title]Export preset"></i> | |
| 3221 | + <i data-newbie-hidden data-preset-manager-restore="instruct" class=" menu_button fa-solid fa-recycle" title="Restore current preset" data-i18n="[title]Restore current preset"></i> | |
| 3222 | + <i data-preset-manager-delete="instruct" class=" menu_button fa-solid fa-trash-can" title="Delete the preset" data-i18n="[title]Delete the preset"></i> | |
| 3223 | + </div> | |
| 3224 | + | |
| 3225 | + <div class="flex-container"> | |
| 3226 | + <select id="instruct_presets" data-preset-manager-for="instruct" class="flex1 text_pole"></select> | |
| 3194 | 3227 | </div> |
| 3195 | 3228 | <label data-newbie-hidden> |
| 3196 | 3229 | <small data-i18n="Activation Regex"> |
| 3197 | - Activation Regex | |
| 3230 | + Activation Regex <span class="fa-solid fa-circle-question" title="When connecting to an API or choosing a model, automatically activate this Instruct Mode template if the model name matches the provided regular expression."></span> | |
| 3198 | 3231 | </small> |
| 3199 | 3232 | </label> |
| 3200 | 3233 | <div data-newbie-hidden> |
| 3201 | 3234 | <textareainput type="text" id="instruct_activation_regex" class="text_pole textarea_compact autoSetHeight" maxlengthplaceholder="5000"e.g. rows="/llama(-)?[3|3.1]/i"></textareainput> |
| 3235 | + </div> | |
| 3236 | + <div data-newbie-hidden> | |
| 3237 | + <label> | |
| 3238 | + <small data-i18n="System Prompt">System Prompt</small> | |
| 3239 | + </label> | |
| 3240 | + <div contenteditable="true" id="instruct_system_prompt" class="text_pole textarea_compact"></div> | |
| 3202 | 3241 | </div> |
| 3242 | + | |
| 3203 | 3243 | <div data-newbie-hidden> |
| 3204 | 3244 | <label for="instruct_wrap" class="checkbox_label"> |
| 3205 | 3245 | <input id="instruct_wrap" type="checkbox" /> |
| 3206 | 3246 | <spansmall data-i18n="Wrap Sequences with Newline">Wrap Sequences with Newline</spansmall> |
| 3207 | 3247 | </label> |
| 3208 | 3248 | <label for="instruct_macro" class="checkbox_label"> |
| 3209 | 3249 | <input id="instruct_macro" type="checkbox" /> |
| 3210 | 3250 | <spansmall data-i18n="Replace Macro in Sequences">Replace Macro in Sequences</spansmall> |
| 3211 | 3251 | </label> |
| 3212 | 3252 | <label for="instruct_skip_examples" class="checkbox_label"> |
| 3213 | 3253 | <input id="instruct_skip_examples" type="checkbox" /> |
| 3214 | 3254 | <spansmall data-i18n="Skip Example Dialogues Formatting">Skip Example Dialogues Formatting</spansmall> |
| 3215 | 3255 | </label> |
| 3216 | 3256 | <label for="instruct_names" class="checkbox_label"> |
| 3217 | 3257 | <input id="instruct_names" type="checkbox" /> |
| 3218 | 3258 | <spansmall data-i18n="Include Names">Include Names</spansmall> |
| 3219 | 3259 | </label> |
| 3220 | 3260 | <label for="instruct_names_force_groups" class="checkbox_label indent20p"> |
| 3221 | 3261 | <input id="instruct_names_force_groups" type="checkbox" /> |
| 3222 | 3262 | <spansmall data-i18n="Force for Groups and Personas">Force for Groups and Personas</spansmall> |
| 3223 | 3263 | </label> |
| 3224 | 3264 | </div> |
| 3225 | - <div data-newbie-hidden> | |
| 3226 | - <label> | |
| 3227 | - <small data-i18n="System Prompt">System Prompt</small> | |
| 3228 | - </label> | |
| 3229 | - <textarea id="instruct_system_prompt" class="text_pole textarea_compact autoSetHeight" rows="1"></textarea> | |
| 3230 | 3265 | </div> |
| 3231 | - <div data-newbie-hidden class="inline-drawer wide100p flexFlowColumn"> | |
| 3266 | + <div name="tokenizerSettingsBlock"> | |
| 3232 | - <div class="inline-drawer-toggle inline-drawer-header"> | |
| 3267 | + <div data-newbie-hidden name="tokenizerSelectorBlock"> | |
| 3233 | 3268 | <bh4 class="standoutHeader"><span data-i18n="Instruct Mode SequencesTokenizer">Instruct Mode SequencesTokenizer</span></b> |
| 3234 | - <div class="fa-solid fa-circle-chevron-down inline-drawer-icon down"></div> | |
| 3269 | + <a href="https://docs.sillytavern.app/usage/core-concepts/advancedformatting/#tokenizer" class="notes-link" target="_blank"> | |
| 3270 | + <span class="fa-solid fa-circle-question note-link-span"></span> | |
| 3271 | + </a> | |
| 3272 | + </h4> | |
| 3273 | + <select id="tokenizer"> | |
| 3274 | + <option value="99">Best match (recommended)</option> | |
| 3275 | + <option value="0">None / Estimated</option> | |
| 3276 | + <option value="1">GPT-2</option> | |
| 3277 | + <!-- Option #2 was a legacy GPT-2/3 tokenizer --> | |
| 3278 | + <option value="3">Llama 1/2</option> | |
| 3279 | + <option value="12">Llama 3</option> | |
| 3280 | + <option value="13">Gemma / Gemini</option> | |
| 3281 | + <option value="14">Jamba</option> | |
| 3282 | + <option value="4">NerdStash (NovelAI Clio)</option> | |
| 3283 | + <option value="5">NerdStash v2 (NovelAI Kayra)</option> | |
| 3284 | + <option value="7">Mistral</option> | |
| 3285 | + <option value="8">Yi</option> | |
| 3286 | + <option value="11">Claude 1/2</option> | |
| 3287 | + <option value="6">API (WebUI / koboldcpp)</option> | |
| 3288 | + </select> | |
| 3235 | 3289 | </div> |
| 3236 | - <div class="inline-drawer-content"> | |
| 3290 | + <div class="range-block flex-container flexnowrap" data-newbie-hidden name="tokenPaddingBlock"> | |
| 3237 | - <h5 class="textAlignCenter" data-i18n="System Prompt Wrapping"> | |
| 3291 | + <div class="range-block-title justifyLeft"> | |
| 3238 | - System Prompt Wrapping | |
| 3292 | + <small data-i18n="Token Padding" class="flex-container">Token Padding | |
| 3239 | - </h5> | |
| 3293 | + <a href="https://docs.sillytavern.app/usage/core-concepts/advancedformatting/#token-padding" class="notes-link" target="_blank"> | |
| 3240 | - <div class="flex-container"> | |
| 3294 | + <span class="fa-solid fa-circle-question note-link-span"></span> | |
| 3241 | - <div class="flex1" title="Inserted before a System prompt." data-i18n="[title]Inserted before a System prompt."> | |
| 3295 | + </a> | |
| 3242 | - <label for="instruct_system_sequence_prefix"> | |
| 3296 | + </small> | |
| 3243 | - <small data-i18n="System Prompt Prefix">System Prompt Prefix</small> | |
| 3297 | + </div> | |
| 3244 | - </label> | |
| 3298 | + <input id="token_padding" class="text_pole textarea_compact" type="number" min="-2048" max="2048" /> | |
| 3299 | + </div> | |
| 3300 | + </div> | |
| 3301 | + <div> | |
| 3302 | + <h4 class="standoutHeader" data-i18n="Miscellaneous">Miscellaneous</h4> | |
| 3303 | + <div> | |
| 3304 | + <small> | |
| 3305 | + <span data-i18n="Non-markdown strings"> | |
| 3306 | + Non-markdown strings | |
| 3307 | + </span> | |
| 3308 | + </small> | |
| 3245 | 3309 | <div> |
| 3246 | 3310 | <textareainput id="instruct_system_sequence_prefixmarkdown_escape_strings" class="text_pole textarea_compact autoSetHeight" maxlengthtype="2000text" placeholderdata-i18n="—[placeholder]comma delimited,no spaces between" rowsplaceholder="1comma delimited,no spaces between">< /textarea> |
| 3247 | 3311 | </div> |
| 3248 | 3312 | </div> |
| 3249 | - <div class="flex1" title="Inserted after a System prompt." data-i18n="[title]Inserted after a System prompt."> | |
| 3313 | + | |
| 3250 | - <label for="instruct_system_sequence_suffix"> | |
| 3314 | + <div data-newbie-hidden name="startReplyWithBlock"> | |
| 3251 | - <small data-i18n="System Prompt Suffix">System Prompt Suffix</small> | |
| 3315 | + <div> | |
| 3252 | - </label> | |
| 3316 | + <small> | |
| 3317 | + <span data-i18n="Start Reply With"> | |
| 3318 | + Start Reply With | |
| 3319 | + </span> | |
| 3320 | + </small> | |
| 3253 | 3321 | <div> |
| 3254 | - <textarea id="instruct_system_sequence_suffix" class="text_pole wide100p textarea_compact autoSetHeight" maxlength="2000" placeholder="—" rows="1"></textarea> | |
| 3322 | + <div contenteditable="true" id="start_reply_with" class="text_pole textarea_compact"></div> | |
| 3255 | 3323 | </div> |
| 3324 | + <label class="checkbox_label" for="chat-show-reply-prefix-checkbox"> | |
| 3325 | + <input id="chat-show-reply-prefix-checkbox" type="checkbox" /> | |
| 3326 | + <small data-i18n="Show reply prefix in chat"> | |
| 3327 | + Show reply prefix in chat | |
| 3328 | + </small> | |
| 3329 | + </label> | |
| 3256 | 3330 | </div> |
| 3257 | 3331 | </div> |
| 3258 | - <h5 class="textAlignCenter" data-i18n="Chat Messages Wrapping"> | |
| 3332 | + </div> | |
| 3259 | - Chat Messages Wrapping | |
| 3333 | + </div> | |
| 3260 | - </h5> | |
| 3334 | + <div id="InstructSequencesColumn" class="flex-container flexNoGap flexFlowColumn flex1"> | |
| 3335 | + <div data-newbie-hidden class="wide100p flexFlowColumn"> | |
| 3336 | + <h4 class="standoutHeader title_restorable"> | |
| 3337 | + <b> | |
| 3338 | + <span data-i18n="Instruct Sequences"> | |
| 3339 | + Instruct Sequences | |
| 3340 | + </span> | |
| 3341 | + <small data-i18n="(Saves to Template)"> | |
| 3342 | + (Saves to Template) | |
| 3343 | + </small> | |
| 3344 | + </b> | |
| 3345 | + </h4> | |
| 3261 | 3346 | <div class="flex-container"> |
| 3262 | 3347 | <div class="flex1flexAuto" title="Inserted before a User message and as a lastSystem prompt line when impersonating." data-i18n="[title]Inserted before a User message and as a lastSystem prompt line when impersonating."> |
| 3263 | 3348 | <label for="instruct_input_sequenceinstruct_system_sequence_prefix"> |
| 3264 | 3349 | <small data-i18n="UserSystem MessagePrompt Prefix">UserSystem MessagePrompt Prefix</small> |
| 3265 | 3350 | </label> |
| 3266 | 3351 | <div> |
| 3267 | 3352 | <textarea id="instruct_input_sequence"div classcontenteditable="text_pole textarea_compact autoSetHeighttrue" maxlengthid="2000instruct_system_sequence_prefix" placeholderclass="—"text_pole rows="1textarea_compact"></textareadiv> |
| 3268 | 3353 | </div> |
| 3269 | 3354 | </div> |
| 3270 | 3355 | <div class="flex1flexAuto" title="Inserted after a UserSystem messageprompt." data-i18n="[title]Inserted after a UserSystem messageprompt."> |
| 3271 | 3356 | <label for="instruct_input_suffixinstruct_system_sequence_suffix"> |
| 3272 | 3357 | <small data-i18n="UserSystem MessagePrompt Suffix">UserSystem MessagePrompt Suffix</small> |
| 3273 | 3358 | </label> |
| 3274 | 3359 | <div> |
| 3275 | 3360 | <textareadiv contenteditable="true" id="instruct_input_suffixinstruct_system_sequence_suffix" class="text_pole wide100p textarea_compact autoSetHeight" maxlength="2000" placeholder="—" rows="1"></textareadiv> |
| 3276 | 3361 | </div> |
| 3277 | 3362 | </div> |
| 3278 | 3363 | </div> |
| 3279 | 3364 | <div class="flex-container"> |
| 3280 | 3365 | <div class="flex1flexAuto" title="Inserted before ana AssistantUser message and as a last prompt line when generating an AI replyimpersonating." data-i18n="[title]Inserted before ana AssistantUser message and as a last prompt line when generating an AI replyimpersonating."> |
| 3281 | - <label for="instruct_output_sequence"> | |
| 3366 | + <small data-i18n="User Prefix">User Message Prefix</small> | |
| 3282 | - <small data-i18n="Assistant Message Prefix">Assistant Message Prefix</small> | |
| 3367 | + <div contenteditable="true" id="instruct_input_sequence" class="text_pole textarea_compact"></div> | |
| 3283 | - </label> | |
| 3284 | - <div> | |
| 3285 | - <textarea id="instruct_output_sequence" class="text_pole wide100p textarea_compact autoSetHeight" maxlength="2000" placeholder="—" rows="1"></textarea> | |
| 3286 | 3368 | </div> |
| 3369 | + <div class="flexAuto" title="Inserted after a User message." data-i18n="[title]Inserted after a User message."> | |
| 3370 | + <small data-i18n="User Suffix">User Message Suffix</small> | |
| 3371 | + <div contenteditable="true" id="instruct_input_suffix" class="text_pole wide100p textarea_compact"></div> | |
| 3287 | 3372 | </div> |
| 3288 | - <div class="flex1" title="Inserted after an Assistant message." data-i18n="[title]Inserted after an Assistant message."> | |
| 3289 | - <label for="instruct_output_suffix"> | |
| 3290 | - <small data-i18n="Assistant Message Suffix">Assistant Message Suffix</small> | |
| 3291 | - </label> | |
| 3292 | - <div> | |
| 3293 | - <textarea id="instruct_output_suffix" class="text_pole wide100p textarea_compact autoSetHeight" maxlength="2000" placeholder="—" rows="1"></textarea> | |
| 3294 | 3373 | </div> |
| 3374 | + <div class="flex-container"> | |
| 3375 | + <div class="flexAuto" title="Inserted before an Assistant message and as a last prompt line when generating an AI reply." data-i18n="[title]Inserted before an Assistant message and as a last prompt line when generating an AI reply."> | |
| 3376 | + <small data-i18n="Assistant Prefix">Assistant Message Prefix</small> | |
| 3377 | + <div contenteditable="true" id="instruct_output_sequence" class="text_pole wide100p textarea_compact"></div> | |
| 3295 | 3378 | </div> |
| 3379 | + <div class="flexAuto" title="Inserted after an Assistant message." data-i18n="[title]Inserted after an Assistant message."> | |
| 3380 | + <small data-i18n="Assistant Suffix">Assistant Message Suffix</small> | |
| 3381 | + <div contenteditable="true" id="instruct_output_suffix" class="text_pole wide100p textarea_compact"></div> | |
| 3296 | 3382 | </div> |
| 3297 | - <div class="flex-container"> | |
| 3298 | - <div class="flex1" title="Inserted before a System (added by slash commands or extensions) message." data-i18n="[title]Inserted before a System (added by slash commands or extensions) message."> | |
| 3299 | - <label for="instruct_system_sequence"> | |
| 3300 | - <small data-i18n="System Message Prefix">System Message Prefix</small> | |
| 3301 | - </label> | |
| 3302 | - <div> | |
| 3303 | - <textarea id="instruct_system_sequence" class="text_pole textarea_compact autoSetHeight" maxlength="2000" placeholder="—" rows="1"></textarea> | |
| 3304 | 3383 | </div> |
| 3384 | + <div class="flex-container"> | |
| 3385 | + <div class="flexAuto" id="instruct_system_sequence_block" title="Inserted before a System (added by slash commands or extensions) message." data-i18n="[title]Inserted before a System (added by slash commands or extensions) message."> | |
| 3386 | + <small data-i18n="System Prefix">System Message Prefix</small> | |
| 3387 | + <div contenteditable="true" id="instruct_system_sequence" class="text_pole textarea_compact"></div> | |
| 3305 | 3388 | </div> |
| 3306 | 3389 | <div class="flex1flexAuto" id="instruct_system_suffix_block" title="Inserted after a System message." data-i18n="[title]Inserted after a System message."> |
| 3307 | - <label for="instruct_system_suffix"> | |
| 3390 | + <small data-i18n="System Suffix">System Message Suffix</small> | |
| 3308 | - <small data-i18n="System Message Suffix">System Message Suffix</small> | |
| 3391 | + <div contenteditable="true" id="instruct_system_suffix" class="text_pole wide100p textarea_compact"></div> | |
| 3309 | - </label> | |
| 3310 | - <div> | |
| 3311 | - <textarea id="instruct_system_suffix" class="text_pole wide100p textarea_compact autoSetHeight" maxlength="2000" placeholder="—" rows="1"></textarea> | |
| 3312 | 3392 | </div> |
| 3313 | 3393 | </div> |
| 3314 | 3394 | <div class="flexBasis100p" title="If enabled, System Sequences will be the same as User Sequences." data-i18n="[title]If enabled, System Sequences will be the same as User Sequences."> |
| @@ -3317,238 +3397,50 @@ | ||
| 3317 | 3397 | <small data-i18n="System same as User">System same as User</small> |
| 3318 | 3398 | </label> |
| 3319 | 3399 | </div> |
| 3320 | - </div> | |
| 3400 | + | |
| 3321 | 3401 | <h5 class="textAlignCenter" data-i18n="Misc. Sequences"> |
| 3322 | 3402 | Misc. Sequences |
| 3323 | 3403 | </h5> |
| 3324 | 3404 | <div class="flex-container"> |
| 3325 | 3405 | <div class="flex1flexAuto" title="Inserted before the first Assistant's message." data-i18n="[title]Inserted before the first Assistant's message."> |
| 3326 | - <label for="instruct_first_output_sequence"> | |
| 3327 | 3406 | <small data-i18n="First Assistant Prefix">First Assistant Prefix</small> |
| 3328 | - </label> | |
| 3407 | + <div contenteditable="true" id="instruct_first_output_sequence" class="text_pole textarea_compact"></div> | |
| 3329 | - <div> | |
| 3330 | - <textarea id="instruct_first_output_sequence" class="text_pole textarea_compact autoSetHeight" maxlength="2000" placeholder="—" rows="1"></textarea> | |
| 3331 | - </div> | |
| 3332 | 3408 | </div> |
| 3333 | 3409 | <div class="flex1flexAuto" title="Inserted before the last Assistant's message or as a last prompt line when generating an AI reply (except a neutral/system role)." data-i18n="[title]instruct_last_output_sequence"> |
| 3334 | - <label for="instruct_last_output_sequence"> | |
| 3335 | 3410 | <small data-i18n="Last Assistant Prefix">Last Assistant Prefix</small> |
| 3336 | - </label> | |
| 3411 | + <div contenteditable="true" id="instruct_last_output_sequence" class="text_pole wide100p textarea_compact"></div> | |
| 3337 | - <div> | |
| 3338 | - <textarea id="instruct_last_output_sequence" class="text_pole wide100p textarea_compact autoSetHeight" maxlength="2000" placeholder="—" rows="1"></textarea> | |
| 3339 | - </div> | |
| 3340 | 3412 | </div> |
| 3341 | 3413 | </div> |
| 3342 | 3414 | <div class="flex-container"> |
| 3343 | 3415 | <div class="flex1flexAuto" title="Inserted before the first User's message." data-i18n="[title]Inserted before the first User's message."> |
| 3344 | - <label for="instruct_first_input_sequence"> | |
| 3345 | 3416 | <small data-i18n="First User Prefix">First User Prefix</small> |
| 3346 | - </label> | |
| 3417 | + <div contenteditable="true" id="instruct_first_input_sequence" class="text_pole textarea_compact"></div> | |
| 3347 | - <div> | |
| 3348 | - <textarea id="instruct_first_input_sequence" class="text_pole textarea_compact autoSetHeight" maxlength="2000" placeholder="—" rows="1"></textarea> | |
| 3349 | - </div> | |
| 3350 | 3418 | </div> |
| 3351 | 3419 | <div class="flex1flexAuto" title="Inserted before the last User's message." data-i18n="[title]instruct_last_input_sequence"> |
| 3352 | - <label for="instruct_last_input_sequence"> | |
| 3353 | 3420 | <small data-i18n="Last User Prefix">Last User Prefix</small> |
| 3354 | - </label> | |
| 3421 | + <div contenteditable="true" id="instruct_last_input_sequence" class="text_pole wide100p textarea_compact"></div> | |
| 3355 | - <div> | |
| 3356 | - <textarea id="instruct_last_input_sequence" class="text_pole wide100p textarea_compact autoSetHeight" maxlength="2000" placeholder="—" rows="1"></textarea> | |
| 3357 | - </div> | |
| 3358 | 3422 | </div> |
| 3359 | 3423 | </div> |
| 3360 | 3424 | <div class="flex-container"> |
| 3361 | 3425 | <div class="flex1flexAuto" title="Will be inserted as a last prompt line when using system/neutral generation." data-i18n="[title]Will be inserted as a last prompt line when using system/neutral generation."> |
| 3362 | - <label for="instruct_last_system_sequence"> | |
| 3363 | 3426 | <small data-i18n="System Instruction Prefix">System Instruction Prefix</small> |
| 3364 | - </label> | |
| 3427 | + <div contenteditable="true" id="instruct_last_system_sequence" class="text_pole textarea_compact"></div> | |
| 3365 | - <div> | |
| 3366 | - <textarea id="instruct_last_system_sequence" class="text_pole textarea_compact autoSetHeight" maxlength="2000" placeholder="—" rows="1"></textarea> | |
| 3367 | - </div> | |
| 3368 | 3428 | </div> |
| 3369 | 3429 | <div class="flex1flexAuto" title="If a stop sequence is generated, everything past it will be removed from the output (inclusive)." data-i18n="[title]If a stop sequence is generated, everything past it will be removed from the output (inclusive)."> |
| 3370 | - <label for="instruct_stop_sequence"> | |
| 3371 | 3430 | <small data-i18n="Stop Sequence">Stop Sequence</small> |
| 3372 | - </label> | |
| 3431 | + <div contenteditable="true" id="instruct_stop_sequence" class="text_pole textarea_compact"></div> | |
| 3373 | - <div> | |
| 3374 | - <textarea id="instruct_stop_sequence" class="text_pole textarea_compact autoSetHeight" maxlength="2000" placeholder="—" rows="1"></textarea> | |
| 3375 | - </div> | |
| 3376 | 3432 | </div> |
| 3377 | 3433 | </div> |
| 3378 | 3434 | <div class="flex-container"> |
| 3379 | 3435 | <div class="flex1flexAuto" title="Will be inserted at the start of the chat history if it doesn't start with a User message." data-i18n="[title]Will be inserted at the start of the chat history if it doesn't start with a User message."> |
| 3380 | - <label for="instruct_user_alignment_message"> | |
| 3381 | 3436 | <small data-i18n="User Filler Message">User Filler Message</small> |
| 3382 | - </label> | |
| 3437 | + <div contenteditable="true" id="instruct_user_alignment_message" class="text_pole textarea_compact"></div> | |
| 3383 | - <div> | |
| 3384 | - <textarea id="instruct_user_alignment_message" class="text_pole textarea_compact autoSetHeight" maxlength="2000" placeholder="—" rows="1"></textarea> | |
| 3385 | - </div> | |
| 3386 | 3438 | </div> |
| 3387 | 3439 | </div> |
| 3388 | 3440 | </div> |
| 3389 | 3441 | </div> |
| 3390 | 3442 | </div> |
| 3391 | 3443 | </div> |
| 3392 | - <div id="ContextFormatting"> | |
| 3393 | - <div> | |
| 3394 | - <div class="flex-container alignItemsBaseline"> | |
| 3395 | - <h4 data-i18n="Context Formatting"> | |
| 3396 | - Context Formatting | |
| 3397 | - </h4> | |
| 3398 | - <small data-i18n="(Saved to Context Template)"> | |
| 3399 | - (Saved to Context Template) | |
| 3400 | - </small> | |
| 3401 | - </div> | |
| 3402 | - <label class="checkbox_label" for="always-force-name2-checkbox"> | |
| 3403 | - <input id="always-force-name2-checkbox" type="checkbox" /> | |
| 3404 | - <span data-i18n="Always add character's name to prompt"> | |
| 3405 | - Always add character's name to prompt | |
| 3406 | - </span> | |
| 3407 | - </label> | |
| 3408 | - <label class="checkbox_label" for="single_line"> | |
| 3409 | - <input id="single_line" type="checkbox" /> | |
| 3410 | - <span data-i18n="Generate only one line per request"> | |
| 3411 | - Generate only one line per request | |
| 3412 | - </span> | |
| 3413 | - </label> | |
| 3414 | - <label class="checkbox_label" for="trim_sentences_checkbox"> | |
| 3415 | - <input id="trim_sentences_checkbox" type="checkbox" /> | |
| 3416 | - <span data-i18n="Trim Incomplete Sentences"> | |
| 3417 | - Trim Incomplete Sentences | |
| 3418 | - </span> | |
| 3419 | - </label> | |
| 3420 | - <!-- Add margin since this is a child of above --> | |
| 3421 | - <label data-newbie-hidden class="checkbox_label indent20p" for="include_newline_checkbox"> | |
| 3422 | - <input id="include_newline_checkbox" type="checkbox" /> | |
| 3423 | - <span data-i18n="Include Newline">Include Newline</span> | |
| 3424 | - </label> | |
| 3425 | - </div> | |
| 3426 | - <h4 data-i18n="Misc. Settings"> | |
| 3427 | - Misc. Settings | |
| 3428 | - </h4> | |
| 3429 | - <label class="checkbox_label" for="collapse-newlines-checkbox"> | |
| 3430 | - <input id="collapse-newlines-checkbox" type="checkbox" /> | |
| 3431 | - <span data-i18n="Collapse Consecutive Newlines"> | |
| 3432 | - Collapse Consecutive Newlines | |
| 3433 | - </span> | |
| 3434 | - </label> | |
| 3435 | - <label data-newbie-hidden class="checkbox_label" for="trim_spaces"> | |
| 3436 | - <input id="trim_spaces" type="checkbox" /> | |
| 3437 | - <span data-i18n="Trim spaces">Trim spaces</span> | |
| 3438 | - </label> | |
| 3439 | - <div data-newbie-hidden> | |
| 3440 | - <h4><span data-i18n="Tokenizer">Tokenizer</span> | |
| 3441 | - <a href="https://docs.sillytavern.app/usage/core-concepts/advancedformatting/#tokenizer" class="notes-link" target="_blank"> | |
| 3442 | - <span class="fa-solid fa-circle-question note-link-span"></span> | |
| 3443 | - </a> | |
| 3444 | - </h4> | |
| 3445 | - <select id="tokenizer"> | |
| 3446 | - <option value="99">Best match (recommended)</option> | |
| 3447 | - <option value="0">None / Estimated</option> | |
| 3448 | - <option value="1">GPT-2</option> | |
| 3449 | - <!-- Option #2 was a legacy GPT-2/3 tokenizer --> | |
| 3450 | - <option value="3">Llama 1/2</option> | |
| 3451 | - <option value="12">Llama 3</option> | |
| 3452 | - <option value="13">Gemma / Gemini</option> | |
| 3453 | - <option value="14">Jamba</option> | |
| 3454 | - <option value="4">NerdStash (NovelAI Clio)</option> | |
| 3455 | - <option value="5">NerdStash v2 (NovelAI Kayra)</option> | |
| 3456 | - <option value="7">Mistral</option> | |
| 3457 | - <option value="8">Yi</option> | |
| 3458 | - <option value="11">Claude 1/2</option> | |
| 3459 | - <option value="6">API (WebUI / koboldcpp)</option> | |
| 3460 | - </select> | |
| 3461 | - </div> | |
| 3462 | - <div class="range-block" data-newbie-hidden> | |
| 3463 | - <div class="range-block-title justifyLeft"> | |
| 3464 | - <span data-i18n="Token Padding">Token Padding</span> | |
| 3465 | - <a href="https://docs.sillytavern.app/usage/core-concepts/advancedformatting/#token-padding" class="notes-link" target="_blank"> | |
| 3466 | - <span class="fa-solid fa-circle-question note-link-span"></span> | |
| 3467 | - </a> | |
| 3468 | - </div> | |
| 3469 | - <input id="token_padding" class="text_pole textarea_compact" type="number" min="-2048" max="2048" /> | |
| 3470 | - </div> | |
| 3471 | - <div class="flex-container flexFlowColumn" data-newbie-hidden> | |
| 3472 | - <div> | |
| 3473 | - <h4 class="range-block-title justifyLeft"> | |
| 3474 | - <span data-i18n="Start Reply With"> | |
| 3475 | - Start Reply With | |
| 3476 | - </span> | |
| 3477 | - </h4> | |
| 3478 | - <div> | |
| 3479 | - <textarea id="start_reply_with" rows="2" class="text_pole textarea_compact" data-i18n="[placeholder]AI reply prefix" placeholder="AI reply prefix"></textarea> | |
| 3480 | - </div> | |
| 3481 | - <label class="checkbox_label" for="chat-show-reply-prefix-checkbox"> | |
| 3482 | - <input id="chat-show-reply-prefix-checkbox" type="checkbox" /> | |
| 3483 | - <span data-i18n="Show reply prefix in chat"> | |
| 3484 | - Show reply prefix in chat | |
| 3485 | - </span> | |
| 3486 | - </label> | |
| 3487 | - </div> | |
| 3488 | - <div> | |
| 3489 | - <h4 class="range-block-title justifyLeft"> | |
| 3490 | - <span data-i18n="Non-markdown strings"> | |
| 3491 | - Non-markdown strings | |
| 3492 | - </span> | |
| 3493 | - </h4> | |
| 3494 | - <div> | |
| 3495 | - <input id="markdown_escape_strings" class="text_pole textarea_compact" type="text" data-i18n="[placeholder]separate with commas w/o space between" placeholder="separate with commas w/o space between" maxlength="100" /> | |
| 3496 | - </div> | |
| 3497 | - </div> | |
| 3498 | - <div> | |
| 3499 | - <h4 class="range-block-title justifyLeft"> | |
| 3500 | - <span data-i18n="Custom Stopping Strings"> | |
| 3501 | - Custom Stopping Strings | |
| 3502 | - </span> | |
| 3503 | - <a href="https://docs.sillytavern.app/usage/core-concepts/advancedformatting/#custom-stopping-strings" class="notes-link" target="_blank"> | |
| 3504 | - <span class="fa-solid fa-circle-question note-link-span"></span> | |
| 3505 | - </a> | |
| 3506 | - </h4> | |
| 3507 | - <div> | |
| 3508 | - <small> | |
| 3509 | - <span data-i18n="JSON serialized array of strings">JSON serialized array of strings</span> | |
| 3510 | - </small> | |
| 3511 | - </div> | |
| 3512 | - <div> | |
| 3513 | - <textarea id="custom_stopping_strings" rows="2" class="text_pole textarea_compact monospace" placeholder="["Ford", "BMW", "Fiat"]"></textarea> | |
| 3514 | - </div> | |
| 3515 | - <label class="checkbox_label" for="custom_stopping_strings_macro"> | |
| 3516 | - <input id="custom_stopping_strings_macro" type="checkbox" checked> | |
| 3517 | - <span data-i18n="Replace Macro in Custom Stopping Strings"> | |
| 3518 | - Replace Macro in Custom Stopping Strings | |
| 3519 | - </span> | |
| 3520 | - </label> | |
| 3521 | - </div> | |
| 3522 | - </div> | |
| 3523 | - <div data-newbie-hidden> | |
| 3524 | - <h4> | |
| 3525 | - <span data-i18n="Auto-Continue">Auto-Continue</span> | |
| 3526 | - </h4> | |
| 3527 | - <div class="flex-container"> | |
| 3528 | - <label class="checkbox_label" for="auto_continue_enabled"> | |
| 3529 | - <input id="auto_continue_enabled" type="checkbox" /> | |
| 3530 | - <span data-i18n="Enabled"> | |
| 3531 | - Enabled | |
| 3532 | - </span> | |
| 3533 | - </label> | |
| 3534 | - <label class="checkbox_label" for="auto_continue_allow_chat_completions"> | |
| 3535 | - <input id="auto_continue_allow_chat_completions" type="checkbox" /> | |
| 3536 | - <span data-i18n="Allow for Chat Completion APIs"> | |
| 3537 | - Allow for Chat Completion APIs | |
| 3538 | - </span> | |
| 3539 | - </label> | |
| 3540 | - </div> | |
| 3541 | - | |
| 3542 | - <div class="auto_continue_settings_block"> | |
| 3543 | - <label for="auto_continue_target_length"> | |
| 3544 | - <span data-i18n="Target length (tokens)">Target length (tokens)</span> | |
| 3545 | - <input id="auto_continue_target_length" type="number" class="text_pole textarea_compact" min="0" max="1024" /> | |
| 3546 | - </label> | |
| 3547 | - </div> | |
| 3548 | - </div> | |
| 3549 | - </div> | |
| 3550 | - </div> | |
| 3551 | - </div> | |
| 3552 | 3444 | </div> |
| 3553 | 3445 | <div id="WI-SP-button" class="drawer"> |
| 3554 | 3446 | <div class="drawer-toggle drawer-header"> |
| @@ -3556,12 +3448,14 @@ | ||
| 3556 | 3448 | </div> |
| 3557 | 3449 | <div id="WorldInfo" class="drawer-content closedDrawer"> |
| 3558 | 3450 | <div id="WorldInfoheader" class="fa-solid fa-grip drag-grabber"></div> |
| 3559 | - <div id="WI_panel_pin_div" class="flex-container alignitemscenter gap10px" title="Locked = World Editor will stay open" data-i18n="[title]Locked = World Editor will stay open"> | |
| 3451 | + <div class="flex-container alignitemscenter gap10px"> | |
| 3452 | + <div id="WI_panel_pin_div" title="Locked = World Editor will stay open" data-i18n="[title]Locked = World Editor will stay open"> | |
| 3560 | 3453 | <input type="checkbox" id="WI_panel_pin"> |
| 3561 | 3454 | <label for="WI_panel_pin"> |
| 3562 | 3455 | <div class="unchecked fa-solid fa-unlock "></div> |
| 3563 | 3456 | <div class="checked fa-solid fa-lock "></div> |
| 3564 | 3457 | </label> |
| 3458 | + </div> | |
| 3565 | 3459 | <h3 class="margin0"> |
| 3566 | 3460 | <span data-i18n="Worlds/Lorebooks">Worlds/Lorebooks</span> |
| 3567 | 3461 | <a href="https://docs.sillytavern.app/usage/core-concepts/worldinfo/" class="notes-link" target="_blank"> |
| @@ -4290,15 +4184,49 @@ | ||
| 4290 | 4184 | <input id="auto_swipe_minimum_length" name="auto_swipe_minimum_length" type="number" min="0" step="1" value="0" class="text_pole" title="If the generated message is shorter than this, trigger an auto-swipe." data-i18n="[title]If the generated message is shorter than this, trigger an auto-swipe"> |
| 4291 | 4185 | <small data-i18n="Blacklisted words">Blacklisted words</small> |
| 4292 | 4186 | <div class="auto_swipe"> |
| 4293 | 4187 | <textarea id="auto_swipe_blacklist" name="auto_swipe_blacklist" data-i18n="[placeholder]words you dont want generated separated by comma ','" placeholder="words you don't want generated separated by comma ','" class="text_pole textarea_compact" maxlength="5000" value="" autocomplete="off" rows="3"></textarea> |
| 4294 | 4188 | <small data-i18n="Blacklisted word count to swipe">Blacklisted word count to swipe</small> |
| 4295 | 4189 | <input id="auto_swipe_blacklist_threshold" name="auto_swipe_blacklist_threshold" type="number" min="0" step="1" value="1" class="text_pole" title="Minimum number of blacklisted words detected to trigger an auto-swipe." data-i18n="[title]Minimum number of blacklisted words detected to trigger an auto-swipe"> |
| 4296 | 4190 | </div> |
| 4297 | 4191 | </div> |
| 4298 | 4192 | </div> |
| 4193 | + <div data-newbie-hidden nane="AutoContiueBlock" class="inline-drawer wide100p flexFlowColumn"> | |
| 4194 | + <div class="inline-drawer-toggle inline-drawer-header userSettingsInnerExpandable" title="Automatically 'continue' a response if the model stopped before reaching a certain amount of tokens."> | |
| 4195 | + <b><span data-i18n="Auto-swipe">Auto-Continue</span></b> | |
| 4196 | + <div class="fa-solid fa-circle-chevron-down inline-drawer-icon down"></div> | |
| 4197 | + </div> | |
| 4198 | + <div class="inline-drawer-content"> | |
| 4199 | + <div class="flex-container"> | |
| 4200 | + <label class="checkbox_label" for="auto_continue_enabled"> | |
| 4201 | + <input id="auto_continue_enabled" type="checkbox" /> | |
| 4202 | + <small data-i18n="Enabled"> | |
| 4203 | + Enabled | |
| 4204 | + </small> | |
| 4205 | + </label> | |
| 4206 | + <label class="checkbox_label" for="auto_continue_allow_chat_completions"> | |
| 4207 | + <input id="auto_continue_allow_chat_completions" type="checkbox" /> | |
| 4208 | + <small data-i18n="Allow for Chat Completion APIs"> | |
| 4209 | + Allow for Chat Completion APIs | |
| 4210 | + </small> | |
| 4211 | + </label> | |
| 4212 | + </div> | |
| 4213 | + <div class="auto_continue_settings_block"> | |
| 4214 | + <label for="auto_continue_target_length"> | |
| 4215 | + <small data-i18n="Target length (tokens)">Target length (tokens)</small> | |
| 4216 | + <input id="auto_continue_target_length" type="number" class="text_pole textarea_compact" min="0" max="1024" /> | |
| 4217 | + </label> | |
| 4218 | + </div> | |
| 4219 | + </div> | |
| 4220 | + | |
| 4221 | + | |
| 4222 | + </div> | |
| 4223 | + </div> | |
| 4224 | + <div name="AutoCompleteToggle" class="inline-drawer wide100p flexFlowColumn"> | |
| 4225 | + <div class="inline-drawer-toggle inline-drawer-header userSettingsInnerExpandable" title="Options for the various autocompelte input boxes."> | |
| 4226 | + <b><span data-i18n="AutoComplete Settings">AutoComplete Settings</span></b> | |
| 4227 | + <div class="fa-solid fa-circle-chevron-down inline-drawer-icon down"></div> | |
| 4299 | 4228 | </div> |
| 4300 | 4229 | <div nameclass="AutoCompleteToggleinline-drawer-content"> |
| 4301 | - <h4 data-i18n="AutoComplete Settings">AutoComplete Settings</h4> | |
| 4302 | 4230 | <label data-newbie-hidden class="checkbox_label" for="stscript_autocomplete_autoHide"> |
| 4303 | 4231 | <input id="stscript_autocomplete_autoHide" type="checkbox" /> |
| 4304 | 4232 | <small data-i18n="Automatically hide details"> |
| @@ -4363,6 +4291,7 @@ | ||
| 4363 | 4291 | </div> |
| 4364 | 4292 | </div> |
| 4365 | 4293 | </div> |
| 4294 | + </div> | |
| 4366 | 4295 | <div name="STscriptToggles"> |
| 4367 | 4296 | <h4 data-i18n="STscript Settings">STscript Settings</h4> |
| 4368 | 4297 | <div title="Sets default flags for the STscript parser." data-i18n="[title]Sets default flags for the STscript parser."> |
| @@ -4491,8 +4420,8 @@ | ||
| 4491 | 4420 | </div> |
| 4492 | 4421 | </div> |
| 4493 | 4422 | <div class="alignitemsflexstart flex-container wide100p"> |
| 4494 | 4423 | <input id="extensions_url" type="text" class="flex1 heightFitContent text_pole widthNatural" maxlength="250" data-i18n="[placeholder]Extras API URL" placeholder="Extras API URL"> |
| 4495 | 4424 | <input id="extensions_api_key" type="text" class="flex1 heightFitContent text_pole widthNatural" maxlength="250" data-i18n="[placeholder]Extras API key (optional)" placeholder="Extras API key (optional)"> |
| 4496 | 4425 | <div class="extensions_url_block"> |
| 4497 | 4426 | <div id="extensions_connect" class="menu_button" data-i18n="Connect">Connect</div> |
| 4498 | 4427 | </div> |
| @@ -4536,7 +4465,7 @@ | ||
| 4536 | 4465 | <i class="fa-solid fa-person-circle-question fa-fw"></i> |
| 4537 | 4466 | <div data-i18n="Create">Create</div> |
| 4538 | 4467 | </div> |
| 4539 | 4468 | <input id="persona_search_bar" class="text_pole width100p flex1 margin0" type="search" data-i18n="[placeholder]Search..." placeholder="Search..." maxlength="100"> |
| 4540 | 4469 | <select id="persona_sort_order" class="margin0"> |
| 4541 | 4470 | <option value="search" data-i18n="Search" hidden>Search</option> |
| 4542 | 4471 | <option value="asc">A-Z</option> |
| @@ -4556,7 +4485,7 @@ | ||
| 4556 | 4485 | <div class="flex1"> |
| 4557 | 4486 | <h4 data-i18n="Name">Name</h4> |
| 4558 | 4487 | <div class="change_name"> |
| 4559 | 4488 | <input id="your_name" name="your_name" data-i18n="[placeholder]Enter your name" placeholder="Enter your name" class="text_pole wide100p" maxlength="100" value="" autocomplete="off"> |
| 4560 | 4489 | <div id="your_name_button" class="menu_button fa-solid fa-check" title="Click to set a new User Name" data-i18n="[title]Click to set a new User Name"> |
| 4561 | 4490 | </div> |
| 4562 | 4491 | <div id="lock_user_name" class="menu_button fa-solid fa-unlock" title="Click to lock your selected persona to the current chat. Click again to remove the lock." data-i18n="[title]Click to lock your selected persona to the current chat. Click again to remove the lock."> |
| @@ -4566,7 +4495,7 @@ | ||
| 4566 | 4495 | </div> |
| 4567 | 4496 | <div> |
| 4568 | 4497 | <h4 data-i18n="Persona Description">Persona Description</h4> |
| 4569 | 4498 | <textarea id="persona_description" name="persona_description" data-i18n="[placeholder]Example: [{{user}} is a 28-year-old Romanian cat girl.]" placeholder="Example: [{{user}} is a 28-year-old Romanian cat girl.]" class="text_pole textarea_compact" maxlength="50000" value="" autocomplete="off" rows="8"></textarea> |
| 4570 | 4499 | <div class="extension_token_counter"> |
| 4571 | 4500 | <span data-i18n="Tokens persona description">Tokens</span>: <span id="persona_description_token_count">0</span> |
| 4572 | 4501 | </div> |
| @@ -4660,7 +4589,7 @@ | ||
| 4660 | 4589 | <form id="form_create" action="javascript:void(null);" method="post" enctype="multipart/form-data"> |
| 4661 | 4590 | <div id="avatar-and-name-block"> |
| 4662 | 4591 | <div id="name_div"> |
| 4663 | 4592 | <input id="character_name_pole" name="ch_name" class="text_pole" data-i18n="[placeholder]Name this character" placeholder="Name this character" maxlength="100" value="" autocomplete="off"> |
| 4664 | 4593 | <div class="extension_token_counter"> |
| 4665 | 4594 | <span data-i18n="extension_token_counter">Tokens:</span> <span data-token-counter="character_name_pole" data-token-permanent="true">counting...</span> |
| 4666 | 4595 | </div> |
| @@ -4731,7 +4660,7 @@ | ||
| 4731 | 4660 | </div> |
| 4732 | 4661 | <div id="tags_div"> |
| 4733 | 4662 | <div class="tag_controls"> |
| 4734 | 4663 | <input id="tagInput" class="text_pole textarea_compact tag_input wide100p margin0" data-i18n="[placeholder]Search / Create Tags" placeholder="Search / Create tags" maxlength="50" /> |
| 4735 | 4664 | <div class="tags_view menu_button fa-solid fa-tags" title="View all tags" data-i18n="[title]View all tags"></div> |
| 4736 | 4665 | </div> |
| 4737 | 4666 | <div id="tagList" class="tags"></div> |
| @@ -4816,12 +4745,12 @@ | ||
| 4816 | 4745 | <div class="inline-drawer-content"> |
| 4817 | 4746 | <div id="group-metadata-controls" class="marginTopBot5"> |
| 4818 | 4747 | <div class="flex-container wide100p"> |
| 4819 | 4748 | <input id="rm_group_chat_name" class="text_pole flex1" type="text" name="chat_name" data-i18n="[placeholder]Chat Name (Optional)" placeholder="Chat Name (Optional)" maxlength="200" /> |
| 4820 | 4749 | <div class="chat_lorebook_button menu_button fa-solid fa-passport" title="Chat Lore" data-i18n="[title]Chat Lore"></div> |
| 4821 | 4750 | </div> |
| 4822 | 4751 | <div id="group_tags_div" class="wide100p"> |
| 4823 | 4752 | <div class="tag_controls"> |
| 4824 | 4753 | <input id="groupTagInput" class="text_pole textarea_compact tag_input flex1 margin0" data-i18n="[placeholder]Search / Create Tags" placeholder="Search / Create tags" maxlength="50" /> |
| 4825 | 4754 | <div class="tags_view menu_button fa-solid fa-tags margin0" title="View all tags" data-i18n="[title]View all tags"></div> |
| 4826 | 4755 | </div> |
| 4827 | 4756 | <div id="groupTagList" class="tags paddingTopBot5"></div> |
| @@ -4863,7 +4792,7 @@ | ||
| 4863 | 4792 | <div class="fa-solid fa-circle-info opacity50p" data-i18n="[title]When 'Join character cards' is selected, all respective fields of the characters are being joined together.This means that in the story string for example all character descriptions will be joined to one big text.If you want those fields to be separated, you can define a prefix or suffix here.This value supports normal macros and will also replace {{char}} with the relevant char's name and <FIELDNAME> with the name of the part (e.g.: description, personality, scenario, etc.)" title="When 'Join character cards' is selected, all respective fields of the characters are being joined together. This means that in the story string for example all character descriptions will be joined to one big text. If you want those fields to be separated, you can define a prefix or suffix here. This value supports normal macros and will also replace {{char}} with the relevant char's name and <FIELDNAME> with the name of the part (e.g.: description, personality, scenario, etc.)"> |
| 4864 | 4793 | </div> |
| 4865 | 4794 | </label> |
| 4866 | 4795 | <textarea id="rm_group_generation_mode_join_prefix" class="text_pole wide100p textarea_compact autoSetHeight" maxlength="2000" placeholder="—" rows="1"></textarea> |
| 4867 | 4796 | </div> |
| 4868 | 4797 | <div class="flex1 flexGap5" title="Inserted after each part of the joined fields." data-i18n="[title]Inserted after each part of the joined fields."> |
| 4869 | 4798 | <label for="rm_group_generation_mode_join_suffix" class="flexnowrap width100p whitespacenowrap"> |
| @@ -4871,7 +4800,7 @@ | ||
| 4871 | 4800 | <div class="fa-solid fa-circle-info opacity50p" data-i18n="[title]When 'Join character cards' is selected, all respective fields of the characters are being joined together.This means that in the story string for example all character descriptions will be joined to one big text.If you want those fields to be separated, you can define a prefix or suffix here.This value supports normal macros and will also replace {{char}} with the relevant char's name and <FIELDNAME> with the name of the part (e.g.: description, personality, scenario, etc.)" title="When 'Join character cards' is selected, all respective fields of the characters are being joined together. This means that in the story string for example all character descriptions will be joined to one big text. If you want those fields to be separated, you can define a prefix or suffix here. This value supports normal macros and will also replace {{char}} with the relevant char's name and <FIELDNAME> with the name of the part (e.g.: description, personality, scenario, etc.)"> |
| 4872 | 4801 | </div> |
| 4873 | 4802 | </label> |
| 4874 | 4803 | <textarea id="rm_group_generation_mode_join_suffix" class="text_pole wide100p textarea_compact autoSetHeight" maxlength="2000" placeholder="—" rows="1"></textarea> |
| 4875 | 4804 | </div> |
| 4876 | 4805 | </div> |
| 4877 | 4806 | <div id="GroupFavDelOkBack" class="flex-container flexGap5 spaceEvenly flex1"> |
| @@ -4926,7 +4855,7 @@ | ||
| 4926 | 4855 | <div class="inline-drawer-content"> |
| 4927 | 4856 | <div name="Unadded Char List" class="flex-container flexFlowColumn overflowYAuto flex1"> |
| 4928 | 4857 | <div id="rm_group_add_members_header"> |
| 4929 | 4858 | <input id="rm_group_filter" class="text_pole margin0" type="search" data-i18n="[placeholder]Search..." placeholder="Search..." maxlength="200" /> |
| 4930 | 4859 | </div> |
| 4931 | 4860 | <div class="rm_tag_controls"> |
| 4932 | 4861 | <div class="tags rm_tag_filter"></div> |
| @@ -4940,7 +4869,7 @@ | ||
| 4940 | 4869 | <div id="rm_character_import" class="right_menu" style="display: none;"> |
| 4941 | 4870 | <form id="form_import" action="javascript:void(null);" method="post" enctype="multipart/form-data"> |
| 4942 | 4871 | <input multiple type="file" id="character_import_file" accept=".json, image/png, .yaml, .yml, .charx" name="avatar"> |
| 4943 | 4872 | <input id="character_import_file_type" name="file_type" class="text_pole" maxlength="999" size="2" value="" autocomplete="off"> |
| 4944 | 4873 | </form> |
| 4945 | 4874 | <input type="file" id="character_replace_file" accept=".json, image/png, .yaml, .yml, .charx" name="replace_avatar" hidden> |
| 4946 | 4875 | </div> |
| @@ -4951,7 +4880,7 @@ | ||
| 4951 | 4880 | <div id="character_import_button" title="Import Character from File" data-i18n="[title]Import Character from File" class="menu_button fa-solid fa-file-import faSmallFontSquareFix"></div> |
| 4952 | 4881 | <div id="external_import_button" title="Import content from external URL" data-i18n="[title]Import content from external URL" class="menu_button fa-solid fa-cloud-arrow-down faSmallFontSquareFix"></div> |
| 4953 | 4882 | <div id="rm_button_group_chats" title="Create New Chat Group" data-i18n="[title]Create New Chat Group" class="menu_button fa-solid fa-users-gear "></div> |
| 4954 | 4883 | <input id="character_search_bar" class="text_pole width100p" type="search" data-i18n="[placeholder]Search..." placeholder="Search..." maxlength="100" /> |
| 4955 | 4884 | <select id="character_sort_order" title="Characters sorting order" data-i18n="[title]Characters sorting order"> |
| 4956 | 4885 | <option data-field="search" data-order="desc" data-i18n="Search" hidden>Search</option> |
| 4957 | 4886 | <option data-field="name" data-order="asc" data-i18n="A-Z">A-Z</option> |
| @@ -4987,6 +4916,61 @@ | ||
| 4987 | 4916 | </div> |
| 4988 | 4917 | </div> |
| 4989 | 4918 | <!-- various fullscreen popups --> |
| 4919 | + <div name="templatesAndPopupsWrapper"> <!--this div is just for IDE sanity for quick collapsing--> | |
| 4920 | + <div id="export_format_popup" class="list-group"> | |
| 4921 | + <div class="export_format list-group-item" data-format="png">PNG</div> | |
| 4922 | + <div class="export_format list-group-item" data-format="json">JSON</div> | |
| 4923 | + </div> | |
| 4924 | + <div id="zoomed_avatar_template" class="template_element"> | |
| 4925 | + <div class="zoomed_avatar"> | |
| 4926 | + <div class="panelControlBar flex-container"> | |
| 4927 | + <div class="fa-fw fa-solid fa-grip drag-grabber"></div> | |
| 4928 | + <div class="fa-fw fa-solid fa-circle-xmark dragClose" id="closeZoom"></div> | |
| 4929 | + </div> | |
| 4930 | + <div class="zoomed_avatar_container"> | |
| 4931 | + <img class="zoomed_avatar_img" src="" data-izoomify-url="" data-izoomify-magnify="1.8" data-izoomify-duration="300" alt=""> | |
| 4932 | + </div> | |
| 4933 | + </div> | |
| 4934 | + </div> | |
| 4935 | + <template id="generic_draggable_template"> | |
| 4936 | + <div class="draggable"> | |
| 4937 | + <div class="dragTitle"></div> | |
| 4938 | + <div class="panelControlBar flex-container"> | |
| 4939 | + <div class="fa-fw fa-solid fa-grip drag-grabber"></div> | |
| 4940 | + <div class="fa-fw fa-solid fa-circle-xmark dragClose"></div> | |
| 4941 | + </div> | |
| 4942 | + </div> | |
| 4943 | + </template> | |
| 4944 | + <div id="user_avatar_template" class="template_element"> | |
| 4945 | + <div class="avatar-container"> | |
| 4946 | + <div imgfile="" class="avatar"> | |
| 4947 | + <img src="" alt="User Avatar"> | |
| 4948 | + </div> | |
| 4949 | + <div class="flex-container wide100pLess70px character_select_container"> | |
| 4950 | + <div class="wide100p character_name_block"> | |
| 4951 | + <span class="ch_name flex1"></span> | |
| 4952 | + <div class="avatar-buttons"> | |
| 4953 | + <button class="menu_button bind_user_name" title="Bind user name to that avatar" data-i18n="[title]Bind user name to that avatar"> | |
| 4954 | + <i class="fa-fw fa-solid fa-user-edit"></i> | |
| 4955 | + </button> | |
| 4956 | + <button class="menu_button set_persona_image" title="Change persona image" data-i18n="[title]Change persona image"> | |
| 4957 | + <i class="fa-fw fa-solid fa-image"></i> | |
| 4958 | + </button> | |
| 4959 | + <button class="menu_button set_default_persona" title="Select this as default persona for the new chats." data-i18n="[title]Select this as default persona for the new chats."> | |
| 4960 | + <i class="fa-fw fa-solid fa-crown"></i> | |
| 4961 | + </button> | |
| 4962 | + <button class="menu_button duplicate_persona" title="Duplicate persona" data-i18n="[title]Duplicate persona"> | |
| 4963 | + <i class="fa-fw fa-solid fa-clone"></i> | |
| 4964 | + </button> | |
| 4965 | + <button class="menu_button delete_avatar" title="Delete persona" data-i18n="[title]Delete persona"> | |
| 4966 | + <i class="fa-fw fa-solid fa-trash-alt"></i> | |
| 4967 | + </button> | |
| 4968 | + </div> | |
| 4969 | + </div> | |
| 4970 | + <div class="ch_description"></div> | |
| 4971 | + </div> | |
| 4972 | + </div> | |
| 4973 | + </div> | |
| 4990 | 4974 | <template id="popup_template" data-i18n="[popup-button-save]popup-button-save;[popup-button-yes]popup-button-yes;[popup-button-no]popup-button-no;[popup-button-cancel]popup-button-cancel;[popup-button-import]popup-button-import;[popup-button-crop]popup-button-crop" popup-button-save="Save" popup-button-yes="Yes" popup-button-no="No" popup-button-cancel="Cancel" popup-button-import="Import" popup-button-crop="Crop"> <!-- localization data holder for popups --> |
| 4991 | 4975 | <dialog class="popup"> |
| 4992 | 4976 | <div class="popup-body"> |
| @@ -4996,7 +4980,7 @@ | ||
| 4996 | 4980 | <div class="popup-crop-wrap"> |
| 4997 | 4981 | <img class="popup-crop-image" src=""> |
| 4998 | 4982 | </div> |
| 4999 | 4983 | <textarea class="popup-input text_pole result-control auto-select" rows="1" data-result="1" data-result-event="submit"></textarea> |
| 5000 | 4984 | <div class="popup-inputs"></div> |
| 5001 | 4985 | <div class="popup-controls"> |
| 5002 | 4986 | <div class="popup-button-ok menu_button result-control" data-result="1" data-i18n="Delete">Delete</div> |
| @@ -5039,14 +5023,14 @@ | ||
| 5039 | 5023 | <small data-i18n="Insert {{original}} into either box to include the respective default prompt from system settings.">Insert {{original}} into either box to include the respective default prompt from system settings.</small> |
| 5040 | 5024 | <div> |
| 5041 | 5025 | <h4 data-i18n="Main Prompt">Main Prompt</h4> |
| 5042 | 5026 | <textarea id="system_prompt_textarea" name="system_prompt" data-i18n="[placeholder]Any contents here will replace the default Main Prompt used for this character. (v2 spec: system_prompt)" placeholder="Any contents here will replace the default Main Prompt used for this character. (v2 spec: system_prompt)" form="form_create" class="text_pole" autocomplete="off" rows="3" maxlength="50000"></textarea> |
| 5043 | 5027 | <div class="extension_token_counter"> |
| 5044 | 5028 | <span data-i18n="extension_token_counter">Tokens:</span> <span data-token-counter="system_prompt_textarea">counting...</span> |
| 5045 | 5029 | </div> |
| 5046 | 5030 | </div> |
| 5047 | 5031 | <div> |
| 5048 | 5032 | <h4 data-i18n="Post-History Instructions">Post-History Instructions</h4> |
| 5049 | 5033 | <textarea id="post_history_instructions_textarea" name="post_history_instructions" data-i18n="[placeholder]Any contents here will replace the default Post-History Instructions used for this character. (v2 spec: post_history_instructions)" placeholder="Any contents here will replace the default Post-History Instructions used for this character. (v2 spec: post_history_instructions)" form="form_create" class="text_pole" autocomplete="off" rows="3" maxlength="50000"></textarea> |
| 5050 | 5034 | <div class="extension_token_counter"> |
| 5051 | 5035 | <span data-i18n="extension_token_counter">Tokens:</span> <span data-token-counter="post_history_instructions_textarea">counting...</span> |
| 5052 | 5036 | </div> |
| @@ -5067,21 +5051,21 @@ | ||
| 5067 | 5051 | <div class="flex-container flexnowrap"> |
| 5068 | 5052 | <div class="flex1"> |
| 5069 | 5053 | <h4 data-i18n="Created by">Created by</h4> |
| 5070 | 5054 | <textarea id="creator_textarea" name="creator" data-i18n="[placeholder](Botmaker's name / Contact Info)" placeholder="(Botmaker's name / Contact info)" form="form_create" class="text_pole" autocomplete="off" rows="2" maxlength="5000"></textarea> |
| 5071 | 5055 | </div> |
| 5072 | 5056 | <div class="flex1"> |
| 5073 | 5057 | <h4 data-i18n="Character Version">Character Version</h4> |
| 5074 | 5058 | <textarea id="character_version_textarea" name="character_version" data-i18n="[placeholder](If you want to track character versions)" placeholder="(If you want to track character versions)" form="form_create" class="text_pole" autocomplete="off" rows="2" maxlength="500"></textarea> |
| 5075 | 5059 | </div> |
| 5076 | 5060 | </div> |
| 5077 | 5061 | <div class="flex-container flexnowrap"> |
| 5078 | 5062 | <div class="flex1"> |
| 5079 | 5063 | <h4 class="flex-box" data-i18n="Creator's Notes">Creator's Notes<i class="editor_maximize fa-solid fa-maximize" data-for="creator_notes_textarea" title="Expand the editor" data-i18n="[title]Expand the editor"></i></h4> |
| 5080 | 5064 | <textarea id="creator_notes_textarea" name="creator_notes" data-i18n="[placeholder](Describe the bot, give use tips, or list the chat models it has been tested on. This will be displayed in the character list.)" placeholder="(Describe the bot, give use tips, or list the chat models it has been tested on. This will be displayed in the character list.)" form="form_create" class="text_pole" autocomplete="off" rows="4" maxlength="20000"></textarea> |
| 5081 | 5065 | </div> |
| 5082 | 5066 | <div class="flex1"> |
| 5083 | 5067 | <h4 data-i18n="Tags to Embed">Tags to Embed</h4> |
| 5084 | 5068 | <textarea id="tags_textarea" name="tags" data-i18n="[placeholder](Write a comma-separated list of tags)" placeholder="(Write a comma-separated list of tags)" form="form_create" class="text_pole" autocomplete="off" rows="4" maxlength="5000"></textarea> |
| 5085 | 5069 | </div> |
| 5086 | 5070 | </div> |
| 5087 | 5071 | </div> |
| @@ -5092,7 +5076,7 @@ | ||
| 5092 | 5076 | <span data-i18n="Personality summary">Personality summary</span> |
| 5093 | 5077 | <a href="https://docs.sillytavern.app/usage/core-concepts/characterdesign/#personality-summary" class="notes-link" target="_blank"><span class="fa-solid fa-circle-question note-link-span"></span></a> |
| 5094 | 5078 | </h4> |
| 5095 | 5079 | <textarea id="personality_textarea" name="personality" data-i18n="[placeholder](A brief description of the personality)" placeholder="(A brief description of the personality)" form="form_create" class="text_pole" autocomplete="off" rows="4" maxlength="50000"></textarea> |
| 5096 | 5080 | <div class="extension_token_counter"> |
| 5097 | 5081 | <span data-i18n="extension_token_counter">Tokens:</span> <span data-token-counter="personality_textarea" data-token-permanent="true">counting...</span> |
| 5098 | 5082 | </div> |
| @@ -5104,7 +5088,7 @@ | ||
| 5104 | 5088 | <span class="fa-solid fa-circle-question note-link-span"></span> |
| 5105 | 5089 | </a> |
| 5106 | 5090 | </h4> |
| 5107 | 5091 | <textarea id="scenario_pole" name="scenario" data-i18n="[placeholder](Circumstances and context of the interaction)" placeholder="(Circumstances and context of the interaction)" class="text_pole" maxlength="50000" value="" autocomplete="off" form="form_create" rows="4"></textarea> |
| 5108 | 5092 | <div class="extension_token_counter"> |
| 5109 | 5093 | <span data-i18n="extension_token_counter">Tokens:</span> <span data-token-counter="scenario_pole" data-token-permanent="true">counting...</span> |
| 5110 | 5094 | </div> |
| @@ -5116,7 +5100,7 @@ | ||
| 5116 | 5100 | Character's Note |
| 5117 | 5101 | </span> |
| 5118 | 5102 | </h4> |
| 5119 | 5103 | <textarea id="depth_prompt_prompt" name="depth_prompt_prompt" class="text_pole" rows="5" maxlength="50000" autocomplete="off" form="form_create" data-i18n="[placeholder](Text to be inserted in-chat @ designated depth and role)" placeholder="(Text to be inserted in-chat @ designated depth and role)"></textarea> |
| 5120 | 5104 | </div> |
| 5121 | 5105 | <div> |
| 5122 | 5106 | <h4> |
| @@ -5158,52 +5142,24 @@ | ||
| 5158 | 5142 | <h4><span data-i18n="Examples of dialogue">Examples of dialogue</span></h4> |
| 5159 | 5143 | <h5 data-i18n="Important to set the character's writing style.">Important to set the character's writing style. <a href="https://docs.sillytavern.app/usage/core-concepts/characterdesign/#examples-of-dialogue" class="notes-link" target="_blank"><span class="fa-solid fa-circle-question note-link-span"></span></a></h5> |
| 5160 | 5144 | </div> |
| 5161 | 5145 | <textarea id="mes_example_textarea" class="flexGrow" name="mes_example" data-i18n="[placeholder](Examples of chat dialog. Begin each example with START on a new line.)" placeholder="(Examples of chat dialog. Begin each example with <START> on a new line.)" form="form_create" maxlength="50000" rows="6"></textarea> |
| 5162 | 5146 | <div class="extension_token_counter"> |
| 5163 | 5147 | <span data-i18n="extension_token_counter">Tokens:</span> <span data-token-counter="mes_example_textarea">counting...</span> |
| 5164 | 5148 | </div> |
| 5165 | - <!-- PLACEHOLDER CODE FOR NEW EXAMPLE CHAT HANDLING | |
| 5149 | + <!-- TODO: Example chats handhold-editor concept: https://gist.github.com/Cohee1207/50da02a4001ac1adae9b440f9b8e1079 --> | |
| 5166 | - <div name="exampleChatsBlockTemplate" class="flex-container flexFlowColumn"> | |
| 5167 | - <div class="flex-container alignitemscenter"> | |
| 5168 | - <textarea class="flexShrink flexGrow wideMinContent" rows="1" placeholder="Name for this example chat"></textarea> | |
| 5169 | - <div class="fa-solid fa-plus menu_button" title="Add a new message to this example chat block"></div> | |
| 5170 | - </div> | |
| 5171 | - <div class="flex-container whitespacenowrap"> | |
| 5172 | - <div class="flex-container flexFlowColumn"> | |
| 5173 | - <select> | |
| 5174 | - <option>{{user}}</option> | |
| 5175 | - <option>{{char}}</option> | |
| 5176 | - <option>Custom</option> | |
| 5177 | - </select> | |
| 5178 | - <textarea rows="1" placeholder="Custom Entity"></textarea> | |
| 5179 | - </div> | |
| 5180 | - <textarea class="flexShrink flexGrow wideMinContent" placeholder="Content of the example chat."></textarea> | |
| 5181 | - </div> | |
| 5182 | - <div class="flex-container whitespacenowrap"> | |
| 5183 | - <div class="flex-container flexFlowColumn"> | |
| 5184 | - <select> | |
| 5185 | - <option>{{user}}</option> | |
| 5186 | - <option>{{char}}</option> | |
| 5187 | - <option>Custom</option> | |
| 5188 | - </select> | |
| 5189 | - <textarea rows="1" placeholder="Custom Entity"></textarea> | |
| 5190 | - </div> | |
| 5191 | - <textarea class="flexShrink flexGrow wideMinContent" placeholder="Content of the example chat."></textarea> | |
| 5192 | - </div> | |
| 5193 | - </div> | |
| 5194 | - --> | |
| 5195 | 5150 | </div> |
| 5196 | 5151 | <div id="character_popup_ok" class="menu_button" data-i18n="Save">Save</div> |
| 5197 | 5152 | </div> |
| 5153 | + | |
| 5198 | 5154 | <div id="shadow_select_chat_popup"> |
| 5199 | 5155 | <div id="select_chat_popup"> |
| 5200 | 5156 | <div name="selectChatPopupHeader" class="flex-container alignitemscenter justifySpaceBetween flexGap10"> |
| 5201 | 5157 | <div id="select_chat_import"> <!-- import chat popup header --> |
| 5202 | 5158 | <form id="form_import_chat" action="javascript:void(null);" method="post" enctype="multipart/form-data" style="display: none;"> |
| 5203 | 5159 | <input type="file" id="chat_import_file" accept=".json, .jsonl" name="avatar"> |
| 5204 | 5160 | <input id="chat_import_file_type" name="file_type" class="text_pole" maxlength="999" size="2" value="" autocomplete="off" style="display: none;"> |
| 5205 | 5161 | <input id="chat_import_avatar_url" name="avatar_url" class="text_pole" maxlength="999" size="2" value="" autocomplete="off" style="display: none;"> |
| 5206 | 5162 | <input id="chat_import_character_name" name="character_name" class="text_pole" maxlength="999" size="2" value="" autocomplete="off" style="display: none;"> |
| 5207 | 5163 | </form> |
| 5208 | 5164 | </div> |
| 5209 | 5165 | <div id="selectChatPopupHeaderText" class="TxtLrgBoldCenter"> |
| @@ -5335,22 +5291,21 @@ | ||
| 5335 | 5291 | <div class="world_entry"> |
| 5336 | 5292 | <form class="world_entry_form wi-card-entry"> |
| 5337 | 5293 | <div class="inline-drawer wide100p"> |
| 5338 | 5294 | <div class="inline-drawer-toggle inline-drawer-header gap5px padding0"> |
| 5339 | 5295 | <span class="drag-handle">☰</span> |
| 5340 | 5296 | <div class="gap5px world_entry_thin_controls wide100p alignitemscenter"> |
| 5341 | 5297 | <div class="inline-drawer-toggle fa-fw fa-solid fa-circle-chevron-down inline-drawer-icon down"></div> |
| 5342 | - <div class="fa-solid fa-toggle-on killSwitch" name="entryKillSwitch" title="Toggle entry's active state."></div> | |
| 5343 | 5298 | <div class="flex-container alignitemscenter wide100p"> |
| 5344 | - | |
| 5345 | 5299 | <div class="WIEntryTitleAndStatus flex-container flex1 alignitemscenter"> |
| 5346 | - | |
| 5347 | 5300 | <div class="flex-container flex1"> |
| 5348 | 5301 | <textarea class="text_pole" rows="1" name="comment" maxlength="5000" data-i18n="[placeholder]Entry Title/Memo" placeholder="Entry Title/Memo"></textarea> |
| 5349 | 5302 | </div> |
| 5303 | + <!-- <span class="world_entry_form_position_value"></span> --> | |
| 5350 | 5304 | <select data-i18n="[title]WI Entry Status:🔵 Constant🟢 Normal🔗 Vectorized❌ Disabled" title="WI Entry Status: 🔵 Constant 🟢 Normal 🔗 Vectorized ❌ Disabled" name="entryStateSelector" class="text_pole widthNatural margin0"> |
| 5351 | 5305 | <option value="constant" title="Constant" data-i18n="[title]WI_Entry_Status_Constant">🔵</option> |
| 5352 | 5306 | <option value="normal" title="Normal" data-i18n="[title]WI_Entry_Status_Normal">🟢</option> |
| 5353 | 5307 | <option value="vectorized" title="Vectorized" data-i18n="[title]WI_Entry_Status_Vectorized">🔗</option> |
| 5308 | + <option value="disabled" title="Disabled" data-i18n="[title]WI_Entry_Status_Disabled">❌</option> | |
| 5354 | 5309 | </select> |
| 5355 | 5310 | </div> |
| 5356 | 5311 | <div class="WIEnteryHeaderControls flex-container"> |
| @@ -5415,7 +5370,7 @@ | ||
| 5415 | 5370 | </small> |
| 5416 | 5371 | <small class="textAlignCenter" data-i18n="Primary Keywords">Primary Keywords</small> |
| 5417 | 5372 | <select class="keyprimaryselect keyselect select2_multi_sameline" name="key" data-i18n="[placeholder]Keywords or Regexes" placeholder="Keywords or Regexes" multiple="multiple"></select> |
| 5418 | 5373 | <textarea class="text_pole keyprimarytextpole mobile" name="key" rows="1" data-i18n="[placeholder]Comma separated list" placeholder="Comma separated list" maxlength="2000" style="display: none;"></textarea> |
| 5419 | 5374 | <button type="button" class="switch_input_type_icon" tabindex="-1" title="Switch to plaintext mode" data-i18n="[title]Switch to plaintext mode" data-icon-on="✨" data-icon-off="⌨️" data-tooltip-on="Switch to fancy mode" data-tooltip-off="Switch to plaintext mode"> |
| 5420 | 5375 | ⌨️ |
| 5421 | 5376 | </button> |
| @@ -5437,7 +5392,7 @@ | ||
| 5437 | 5392 | </small> |
| 5438 | 5393 | <small class="textAlignCenter" data-i18n="Optional Filter">Optional Filter</small> |
| 5439 | 5394 | <select class="keysecondaryselect keyselect select2_multi_sameline" name="keysecondary" data-i18n="[placeholder]Keywords or Regexes (ignored if empty)" placeholder="Keywords or Regexes (ignored if empty)" multiple="multiple"></select> |
| 5440 | 5395 | <textarea class="text_pole keysecondarytextpole mobile" name="keysecondary" rows="1" data-i18n="[placeholder]Comma separated list (ignored if empty)" placeholder="Comma separated list (ignored if empty)" maxlength="2000" style="display: none;"></textarea> |
| 5441 | 5396 | <button type="button" class="switch_input_type_icon" tabindex="-1" title="Switch to plaintext mode" data-i18n="[title]Switch to plaintext mode" data-icon-on="✨" data-icon-off="⌨️" data-tooltip-on="Switch to fancy mode" data-tooltip-off="Switch to plaintext mode"> |
| 5442 | 5397 | ⌨️ |
| 5443 | 5398 | </button> |
| @@ -5599,16 +5554,13 @@ | ||
| 5599 | 5554 | <div class="flex-container wide100p flexGap10"> |
| 5600 | 5555 | <div class="flex4 flex-container flexFlowColumn flexNoGap"> |
| 5601 | 5556 | <div class="flex-container justifySpaceBetween"> |
| 5602 | 5557 | <small for="characterFilter" data-i18n="Filter to Characters or TagsCharacter(s)"> |
| 5603 | - Filter to Characters or Tags | |
| 5558 | + Filter to Character(s) | |
| 5604 | 5559 | </small> |
| 5605 | 5560 | <label class="checkbox_label flexNoGap margin-r5" for="character_exclusion"> |
| 5606 | 5561 | <input type="checkbox" name="character_exclusion" /> |
| 5607 | 5562 | <span> |
| 5608 | - <small title="Switch the Character/Tags filter around to exclude the listed characters and tags from matching for this entry" data-i18n="[title]Switch the Character/Tags filter around to exclude the listed characters and tags from matching for this entry"> | |
| 5563 | + <small data-i18n="Character Exclusion">Character Exclusion</small> | |
| 5609 | - <span data-i18n="Exclude">Exclude</span> | |
| 5610 | - <div class="fa-solid fa-circle-info opacity50p"></div> | |
| 5611 | - </small> | |
| 5612 | 5564 | </span> |
| 5613 | 5565 | </label> |
| 5614 | 5566 | </div> |
| @@ -5826,11 +5778,6 @@ | ||
| 5826 | 5778 | <div title="Caption" class="right_menu_button fa-lg fa-solid fa-envelope-open-text mes_img_caption" data-i18n="[title]Caption"></div> |
| 5827 | 5779 | <div title="Delete" class="right_menu_button fa-lg fa-solid fa-trash-can mes_img_delete" data-i18n="[title]Delete"></div> |
| 5828 | 5780 | </div> |
| 5829 | - <div class="mes_img_swipes"> | |
| 5830 | - <div title="Swipe left" class="right_menu_button fa-lg fa-solid fa-chevron-left mes_img_swipe_left" data-i18n="[title]Swipe left"></div> | |
| 5831 | - <div class="mes_img_swipe_counter">1/1</div> | |
| 5832 | - <div title="Swipe right" class="right_menu_button fa-lg fa-solid fa-chevron-right mes_img_swipe_right" data-i18n="[title]Swipe right"></div> | |
| 5833 | - </div> | |
| 5834 | 5781 | <img class="mes_img" src="" /> |
| 5835 | 5782 | </div> |
| 5836 | 5783 | <div class="mes_bias"></div> |
| @@ -5878,6 +5825,21 @@ | ||
| 5878 | 5825 | <b data-i18n="SillyTavern is aimed at advanced users."> |
| 5879 | 5826 | SillyTavern is aimed at advanced users. |
| 5880 | 5827 | </b> |
| 5828 | + <div> | |
| 5829 | + <span data-i18n="If you're new to this, enable the simplified UI mode below."> | |
| 5830 | + If you're new to this, enable the simplified UI mode below. | |
| 5831 | + </span> | |
| 5832 | + <br> | |
| 5833 | + <span data-i18n="Change it later in the 'User Settings' panel."> | |
| 5834 | + Change it later in the 'User Settings' panel. | |
| 5835 | + </span> | |
| 5836 | + </div> | |
| 5837 | + <label class="checkbox_label"> | |
| 5838 | + <input type="checkbox" name="enable_simple_mode" /> | |
| 5839 | + <span data-i18n="Enable simple UI mode"> | |
| 5840 | + Enable simple UI mode | |
| 5841 | + </span> | |
| 5842 | + </label> | |
| 5881 | 5843 | <div class="expander"></div> |
| 5882 | 5844 | <div class="textAlignCenter"> |
| 5883 | 5845 | <h3 data-i18n="Looking for AI characters?"> |
| @@ -6014,7 +5976,7 @@ | ||
| 6014 | 5976 | <strong><span data-i18n="Alternate Greeting #">Alternate Greeting #</span><span class="greeting_index"></span></strong> |
| 6015 | 5977 | <div class="menu_button fa-solid fa-trash-alt delete_alternate_greeting"></div> |
| 6016 | 5978 | </div> |
| 6017 | 5979 | <textarea name="alternate_greetings" data-i18n="[placeholder](This will be the first message from the character that starts every chat)" placeholder="(This will be the first message from the character that starts every chat)" class="text_pole textarea_compact alternate_greeting_text" maxlength="50000" value="" autocomplete="off" rows="16"></textarea> |
| 6018 | 5980 | </div> |
| 6019 | 5981 | </div> |
| 6020 | 5982 | |
| @@ -6031,6 +5993,7 @@ | ||
| 6031 | 5993 | <div class="right_menu_button mes_file_delete fa-solid fa-trash-can" title="Remove the file" data-i18n="[title]Remove the file"></div> |
| 6032 | 5994 | </div> |
| 6033 | 5995 | </div> |
| 5996 | + </div> | |
| 6034 | 5997 | <div id="movingDivs"> |
| 6035 | 5998 | <div id="floatingPrompt" class="drawer-content flexGap5"> |
| 6036 | 5999 | <div class="panelControlBar flex-container alignItemsBaseline"> |
| @@ -6051,7 +6014,7 @@ | ||
| 6051 | 6014 | <b data-i18n="Unique to this chat">Unique to this chat</b>.<br> |
| 6052 | 6015 | <span data-i18n="Checkpoints inherit the Note from their parent, and can be changed individually after that.">Checkpoints inherit the Note from their parent, and can be changed individually after that.</span><br> |
| 6053 | 6016 | </small> |
| 6054 | 6017 | <textarea id="extension_floating_prompt" class="text_pole textarea_compact" rows="8" maxlength="50000"></textarea> |
| 6055 | 6018 | <div class="extension_token_counter"> |
| 6056 | 6019 | <span data-i18n="extension_token_counter">Tokens:</span> <span id="extension_floating_prompt_token_counter">0</span> |
| 6057 | 6020 | </div> |
| @@ -6108,7 +6071,7 @@ | ||
| 6108 | 6071 | <div class="inline-drawer-content"> |
| 6109 | 6072 | <small data-i18n="Will be automatically added as the author's note for this character. Will be used in groups, but can't be modified when a group chat is open.">Will be automatically added as the author's note for this character. Will be used in groups, but |
| 6110 | 6073 | can't be modified when a group chat is open.</small> |
| 6111 | 6074 | <textarea id="extension_floating_chara" class="text_pole textarea_compact" rows="8" maxlength="50000" placeholder="Example: [Scenario: wacky adventures; Genre: romantic comedy; Style: verbose, creative]"></textarea> |
| 6112 | 6075 | <div class="extension_token_counter"> |
| 6113 | 6076 | <span data-i18n="extension_token_counter">Tokens:</span> <span id="extension_floating_chara_token_counter">0</span> |
| 6114 | 6077 | </div> |
| @@ -6140,7 +6103,7 @@ | ||
| 6140 | 6103 | </div> |
| 6141 | 6104 | <div class="inline-drawer-content"> |
| 6142 | 6105 | <small data-i18n="Will be automatically added as the Author's Note for all new chats.">Will be automatically added as the Author's Note for all new chats.</small> |
| 6143 | 6106 | <textarea id="extension_floating_default" class="text_pole textarea_compact" rows="8" maxlength="50000" placeholder="Example: [Scenario: wacky adventures; Genre: romantic comedy; Style: verbose, creative]"></textarea> |
| 6144 | 6107 | <div class="extension_token_counter"> |
| 6145 | 6108 | <span data-i18n="extension_token_counter">Tokens:</span> <span id="extension_floating_default_token_counter">0</span> |
| 6146 | 6109 | </div> |
| @@ -6486,60 +6449,7 @@ | ||
| 6486 | 6449 | </a> |
| 6487 | 6450 | </div> |
| 6488 | 6451 | </div> |
| 6489 | - <div id="export_format_popup" class="list-group"> | |
| 6452 | + | |
| 6490 | - <div class="export_format list-group-item" data-format="png">PNG</div> | |
| 6491 | - <div class="export_format list-group-item" data-format="json">JSON</div> | |
| 6492 | - </div> | |
| 6493 | - <div id="zoomed_avatar_template" class="template_element"> | |
| 6494 | - <div class="zoomed_avatar"> | |
| 6495 | - <div class="panelControlBar flex-container"> | |
| 6496 | - <div class="fa-fw fa-solid fa-grip drag-grabber"></div> | |
| 6497 | - <div class="fa-fw fa-solid fa-circle-xmark dragClose" id="closeZoom"></div> | |
| 6498 | - </div> | |
| 6499 | - <div class="zoomed_avatar_container"> | |
| 6500 | - <img class="zoomed_avatar_img" src="" data-izoomify-url="" data-izoomify-magnify="1.8" data-izoomify-duration="300" alt=""> | |
| 6501 | - </div> | |
| 6502 | - </div> | |
| 6503 | - </div> | |
| 6504 | - <template id="generic_draggable_template"> | |
| 6505 | - <div class="draggable"> | |
| 6506 | - <div class="dragTitle"></div> | |
| 6507 | - <div class="panelControlBar flex-container"> | |
| 6508 | - <div class="fa-fw fa-solid fa-grip drag-grabber"></div> | |
| 6509 | - <div class="fa-fw fa-solid fa-circle-xmark dragClose"></div> | |
| 6510 | - </div> | |
| 6511 | - </div> | |
| 6512 | - </template> | |
| 6513 | - <div id="user_avatar_template" class="template_element"> | |
| 6514 | - <div class="avatar-container"> | |
| 6515 | - <div imgfile="" class="avatar"> | |
| 6516 | - <img src="" alt="User Avatar"> | |
| 6517 | - </div> | |
| 6518 | - <div class="flex-container wide100pLess70px character_select_container"> | |
| 6519 | - <div class="wide100p character_name_block"> | |
| 6520 | - <span class="ch_name flex1"></span> | |
| 6521 | - <div class="avatar-buttons"> | |
| 6522 | - <button class="menu_button bind_user_name" title="Bind user name to that avatar" data-i18n="[title]Bind user name to that avatar"> | |
| 6523 | - <i class="fa-fw fa-solid fa-user-edit"></i> | |
| 6524 | - </button> | |
| 6525 | - <button class="menu_button set_persona_image" title="Change persona image" data-i18n="[title]Change persona image"> | |
| 6526 | - <i class="fa-fw fa-solid fa-image"></i> | |
| 6527 | - </button> | |
| 6528 | - <button class="menu_button set_default_persona" title="Select this as default persona for the new chats." data-i18n="[title]Select this as default persona for the new chats."> | |
| 6529 | - <i class="fa-fw fa-solid fa-crown"></i> | |
| 6530 | - </button> | |
| 6531 | - <button class="menu_button duplicate_persona" title="Duplicate persona" data-i18n="[title]Duplicate persona"> | |
| 6532 | - <i class="fa-fw fa-solid fa-clone"></i> | |
| 6533 | - </button> | |
| 6534 | - <button class="menu_button delete_avatar" title="Delete persona" data-i18n="[title]Delete persona"> | |
| 6535 | - <i class="fa-fw fa-solid fa-trash-alt"></i> | |
| 6536 | - </button> | |
| 6537 | - </div> | |
| 6538 | - </div> | |
| 6539 | - <div class="ch_description"></div> | |
| 6540 | - </div> | |
| 6541 | - </div> | |
| 6542 | - </div> | |
| 6543 | 6453 | <!-- Script includes --> |
| 6544 | 6454 | <script src="lib/diff_match_patch.js"></script> |
| 6545 | 6455 | <script src="lib/object-hasown.js"></script> |
| @@ -452,7 +452,9 @@ export const event_types = { | ||
| 452 | 452 | // TODO: Naming convention is inconsistent with other events |
| 453 | 453 | CHARACTER_DELETED: 'characterDeleted', |
| 454 | 454 | CHARACTER_DUPLICATED: 'character_duplicated', |
| 455 | - SMOOTH_STREAM_TOKEN_RECEIVED: 'smooth_stream_token_received', | |
| 455 | + /** @deprecated The event is aliased to STREAM_TOKEN_RECEIVED. */ | |
| 456 | + SMOOTH_STREAM_TOKEN_RECEIVED: 'stream_token_received', | |
| 457 | + STREAM_TOKEN_RECEIVED: 'stream_token_received', | |
| 456 | 458 | FILE_ATTACHMENT_DELETED: 'file_attachment_deleted', |
| 457 | 459 | WORLDINFO_FORCE_ACTIVATE: 'worldinfo_force_activate', |
| 458 | 460 | OPEN_CHARACTER_LIBRARY: 'open_character_library', |
| @@ -3120,6 +3122,7 @@ class StreamingProcessor { | ||
| 3120 | 3122 | if (logprobs) { |
| 3121 | 3123 | this.messageLogprobs.push(...(Array.isArray(logprobs) ? logprobs : [logprobs])); |
| 3122 | 3124 | } |
| 3125 | + await eventSource.emit(event_types.STREAM_TOKEN_RECEIVED, text); | |
| 3123 | 3126 | await sw.tick(() => this.onProgressStreaming(this.messageId, this.continueMessage + text)); |
| 3124 | 3127 | } |
| 3125 | 3128 | const seconds = (timestamps[timestamps.length - 1] - timestamps[0]) / 1000; |
| @@ -10136,7 +10139,7 @@ jQuery(async function () { | ||
| 10136 | 10139 | } |
| 10137 | 10140 | }); |
| 10138 | 10141 | |
| 10139 | 10142 | $(document).on('click', '.mes_edit_cancel', async function () { |
| 10140 | 10143 | let text = chat[this_edit_mes_id]['mes']; |
| 10141 | 10144 | |
| 10142 | 10145 | $(this).closest('.mes_block').find('.mes_text').empty(); |
| @@ -10154,6 +10157,8 @@ jQuery(async function () { | ||
| 10154 | 10157 | )); |
| 10155 | 10158 | appendMediaToMessage(chat[this_edit_mes_id], $(this).closest('.mes')); |
| 10156 | 10159 | addCopyToCodeBlocks($(this).closest('.mes')); |
| 10160 | + | |
| 10161 | + await eventSource.emit(event_types.MESSAGE_UPDATED, this_edit_mes_id); | |
| 10157 | 10162 | this_edit_mes_id = undefined; |
| 10158 | 10163 | }); |
| 10159 | 10164 | |
| @@ -296,7 +296,7 @@ export async function favsToHotswap() { | ||
| 296 | 296 | |
| 297 | 297 | //helpful instruction message if no characters are favorited |
| 298 | 298 | if (favs.length == 0) { |
| 299 | 299 | container.html(`<small><span><i class="fa-solid fa-star"></i> ${DOMPurify.sanitize(container.attr('no_favs'))}</span></small>`); |
| 300 | 300 | return; |
| 301 | 301 | } |
| 302 | 302 | |
| @@ -15,6 +15,7 @@ import { | ||
| 15 | 15 | generateRaw, |
| 16 | 16 | getMaxContextSize, |
| 17 | 17 | setExtensionPrompt, |
| 18 | + streamingProcessor, | |
| 18 | 19 | } from '../../../script.js'; |
| 19 | 20 | import { is_group_generating, selected_group } from '../../group-chats.js'; |
| 20 | 21 | import { loadMovingUIState } from '../../power-user.js'; |
| @@ -408,8 +409,8 @@ async function onChatEvent() { | ||
| 408 | 409 | return; |
| 409 | 410 | } |
| 410 | 411 | |
| 411 | 412 | // Generation isStreaming in -progress, summary prevented |
| 412 | 413 | if (is_send_pressstreamingProcessor && !streamingProcessor.isFinished) { |
| 413 | 414 | return; |
| 414 | 415 | } |
| 415 | 416 | |
| @@ -446,15 +447,9 @@ async function onChatEvent() { | ||
| 446 | 447 | delete chat[chat.length - 1].extra.memory; |
| 447 | 448 | } |
| 448 | 449 | |
| 449 | - try { | |
| 450 | + summarizeChat(context) | |
| 450 | - await summarizeChat(context); | |
| 451 | + .catch(console.error) | |
| 451 | - } | |
| 452 | + .finally(saveLastValues); | |
| 452 | - catch (error) { | |
| 453 | - console.log(error); | |
| 454 | - } | |
| 455 | - finally { | |
| 456 | - saveLastValues(); | |
| 457 | - } | |
| 458 | 453 | } |
| 459 | 454 | |
| 460 | 455 | /** |
| @@ -567,7 +562,7 @@ async function getSummaryPromptForNow(context, force) { | ||
| 567 | 562 | await waitUntilCondition(() => is_group_generating === false, 1000, 10); |
| 568 | 563 | } |
| 569 | 564 | // Wait for the send button to be released |
| 570 | 565 | await waitUntilCondition(() => is_send_press === false, 30000, 100); |
| 571 | 566 | } catch { |
| 572 | 567 | console.debug('Timeout waiting for is_send_press'); |
| 573 | 568 | return ''; |
| @@ -650,9 +645,16 @@ async function summarizeChatWebLLM(context, force) { | ||
| 650 | 645 | params.max_tokens = extension_settings.memory.overrideResponseLength; |
| 651 | 646 | } |
| 652 | 647 | |
| 648 | + try { | |
| 649 | + inApiCall = true; | |
| 653 | 650 | const summary = await generateWebLlmChatPrompt(messages, params); |
| 654 | 651 | const newContext = getContext(); |
| 655 | 652 | |
| 653 | + if (!summary) { | |
| 654 | + console.warn('Empty summary received'); | |
| 655 | + return; | |
| 656 | + } | |
| 657 | + | |
| 656 | 658 | // something changed during summarization request |
| 657 | 659 | if (newContext.groupId !== context.groupId || |
| 658 | 660 | newContext.chatId !== context.chatId || |
| @@ -663,6 +665,9 @@ async function summarizeChatWebLLM(context, force) { | ||
| 663 | 665 | |
| 664 | 666 | setMemoryContext(summary, true, lastUsedIndex); |
| 665 | 667 | return summary; |
| 668 | + } finally { | |
| 669 | + inApiCall = false; | |
| 670 | + } | |
| 666 | 671 | } |
| 667 | 672 | |
| 668 | 673 | async function summarizeChatMain(context, force, skipWIAN) { |
| @@ -677,12 +682,18 @@ async function summarizeChatMain(context, force, skipWIAN) { | ||
| 677 | 682 | let index = null; |
| 678 | 683 | |
| 679 | 684 | if (prompt_builders.DEFAULT === extension_settings.memory.prompt_builder) { |
| 685 | + try { | |
| 686 | + inApiCall = true; | |
| 680 | 687 | summary = await generateQuietPrompt(prompt, false, skipWIAN, '', '', extension_settings.memory.overrideResponseLength); |
| 688 | + } finally { | |
| 689 | + inApiCall = false; | |
| 690 | + } | |
| 681 | 691 | } |
| 682 | 692 | |
| 683 | 693 | if ([prompt_builders.RAW_BLOCKING, prompt_builders.RAW_NON_BLOCKING].includes(extension_settings.memory.prompt_builder)) { |
| 684 | 694 | const lock = extension_settings.memory.prompt_builder === prompt_builders.RAW_BLOCKING; |
| 685 | 695 | try { |
| 696 | + inApiCall = true; | |
| 686 | 697 | if (lock) { |
| 687 | 698 | deactivateSendButtons(); |
| 688 | 699 | } |
| @@ -700,12 +711,18 @@ async function summarizeChatMain(context, force, skipWIAN) { | ||
| 700 | 711 | summary = await generateRaw(rawPrompt, '', false, false, prompt, extension_settings.memory.overrideResponseLength); |
| 701 | 712 | index = lastUsedIndex; |
| 702 | 713 | } finally { |
| 714 | + inApiCall = false; | |
| 703 | 715 | if (lock) { |
| 704 | 716 | activateSendButtons(); |
| 705 | 717 | } |
| 706 | 718 | } |
| 707 | 719 | } |
| 708 | 720 | |
| 721 | + if (!summary) { | |
| 722 | + console.warn('Empty summary received'); | |
| 723 | + return; | |
| 724 | + } | |
| 725 | + | |
| 709 | 726 | const newContext = getContext(); |
| 710 | 727 | |
| 711 | 728 | // something changed during summarization request |
| @@ -840,6 +857,11 @@ async function summarizeChatExtras(context) { | ||
| 840 | 857 | const summary = await callExtrasSummarizeAPI(resultingString); |
| 841 | 858 | const newContext = getContext(); |
| 842 | 859 | |
| 860 | + if (!summary) { | |
| 861 | + console.warn('Empty summary received'); | |
| 862 | + return; | |
| 863 | + } | |
| 864 | + | |
| 843 | 865 | // something changed during summarization request |
| 844 | 866 | if (newContext.groupId !== context.groupId |
| 845 | 867 | || newContext.chatId !== context.chatId |
| @@ -7,7 +7,7 @@ import { | ||
| 7 | 7 | power_user, |
| 8 | 8 | context_presets, |
| 9 | 9 | } from './power-user.js'; |
| 10 | 10 | import { regexFromString, resetScrollHeight } from './utils.js'; |
| 11 | 11 | |
| 12 | 12 | /** |
| 13 | 13 | * @type {any[]} Instruct mode presets. |
| @@ -78,28 +78,29 @@ function migrateInstructModeSettings(settings) { | ||
| 78 | 78 | * Loads instruct mode settings from the given data object. |
| 79 | 79 | * @param {object} data Settings data object. |
| 80 | 80 | */ |
| 81 | 81 | export async function loadInstructMode(data) { |
| 82 | 82 | if (data.instruct !== undefined) { |
| 83 | 83 | instruct_presets = data.instruct; |
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | migrateInstructModeSettings(power_user.instruct); |
| 87 | 87 | |
| 88 | + $('#instruct_enabled').parent().find('i').toggleClass('toggleEnabled', !!power_user.instruct.enabled); | |
| 89 | + $('#instructSettingsBlock, #InstructSequencesColumn').toggleClass('disabled', !power_user.instruct.enabled); | |
| 90 | + $('#instruct_bind_to_context').parent().find('i').toggleClass('toggleEnabled', !!power_user.instruct.bind_to_context); | |
| 91 | + | |
| 88 | 92 | controls.forEach(control => { |
| 89 | 93 | const $element = $(`#${control.id}`); |
| 90 | 94 | |
| 91 | 95 | if (control.isCheckbox) { |
| 92 | 96 | $element.prop('checked', power_user.instruct[control.property]); |
| 93 | 97 | } else { |
| 94 | 98 | $element[0].valinnerText = (power_user.instruct[control.property]); |
| 95 | 99 | } |
| 96 | 100 | |
| 97 | 101 | $element.on('input', async function () { |
| 98 | 102 | power_user.instruct[control.property] = control.isCheckbox ? !!$(this).prop('checked') : $(this)[0].val()innerText; |
| 99 | 103 | saveSettingsDebounced(); |
| 100 | - if (!control.isCheckbox) { | |
| 101 | - await resetScrollHeight($element); | |
| 102 | - } | |
| 103 | 104 | }); |
| 104 | 105 | |
| 105 | 106 | if (control.trigger) { |
| @@ -107,6 +108,9 @@ export function loadInstructMode(data) { | ||
| 107 | 108 | } |
| 108 | 109 | }); |
| 109 | 110 | |
| 111 | + $('#instruct_system_sequence').css('height', 'auto'); | |
| 112 | + $('#instruct_system_suffix').css('height', 'auto'); | |
| 113 | + | |
| 110 | 114 | instruct_presets.forEach((preset) => { |
| 111 | 115 | const name = preset.name; |
| 112 | 116 | const option = document.createElement('option'); |
| @@ -604,11 +608,29 @@ jQuery(() => { | ||
| 604 | 608 | |
| 605 | 609 | $('#instruct_system_same_as_user').on('input', function () { |
| 606 | 610 | const state = !!$(this).prop('checked'); |
| 607 | - $('#instruct_system_sequence').prop('disabled', state); | |
| 611 | + if (state) { | |
| 608 | 612 | $('#instruct_system_suffixinstruct_system_sequence_block').propaddClass('disabled', state); |
| 613 | + $('#instruct_system_suffix_block').addClass('disabled'); | |
| 614 | + $('#instruct_system_sequence').css('height', 'auto'); | |
| 615 | + $('#instruct_system_suffix').css('height', 'auto'); | |
| 616 | + $('#instruct_system_sequence').prop('contenteditable', false); | |
| 617 | + $('#instruct_system_suffix').prop('contenteditable', false); | |
| 618 | + } else { | |
| 619 | + $('#instruct_system_sequence_block').removeClass('disabled'); | |
| 620 | + $('#instruct_system_suffix_block').removeClass('disabled'); | |
| 621 | + $('#instruct_system_sequence').css('height', ''); | |
| 622 | + $('#instruct_system_suffix').css('height', ''); | |
| 623 | + $('#instruct_system_sequence').prop('contenteditable', true); | |
| 624 | + $('#instruct_system_suffix').prop('contenteditable', true); | |
| 625 | + } | |
| 626 | + | |
| 609 | 627 | }); |
| 610 | 628 | |
| 611 | 629 | $('#instruct_enabled').on('change', function () { |
| 630 | + //color toggle for the main switch | |
| 631 | + $('#instruct_enabled').parent().find('i').toggleClass('toggleEnabled', !!power_user.instruct.enabled); | |
| 632 | + $('#instructSettingsBlock, #InstructSequencesColumn').toggleClass('disabled', !power_user.instruct.enabled); | |
| 633 | + | |
| 612 | 634 | if (!power_user.instruct.bind_to_context) { |
| 613 | 635 | return; |
| 614 | 636 | } |
| @@ -622,6 +644,10 @@ jQuery(() => { | ||
| 622 | 644 | } |
| 623 | 645 | }); |
| 624 | 646 | |
| 647 | + $('#instruct_bind_to_context').on('change', function () { | |
| 648 | + $('#instruct_bind_to_context').parent().find('i').toggleClass('toggleEnabled', !!power_user.instruct.bind_to_context); | |
| 649 | + }); | |
| 650 | + | |
| 625 | 651 | $('#instruct_presets').on('change', function () { |
| 626 | 652 | const name = String($(this).find(':selected').val()); |
| 627 | 653 | const preset = instruct_presets.find(x => x.name === name); |
| @@ -641,7 +667,8 @@ jQuery(() => { | ||
| 641 | 667 | if (control.isCheckbox) { |
| 642 | 668 | $element.prop('checked', power_user.instruct[control.property]).trigger('input'); |
| 643 | 669 | } else { |
| 644 | 670 | $element[0].valinnerText = (power_user.instruct[control.property]).trigger('input'); |
| 671 | + $element.trigger('input'); | |
| 645 | 672 | } |
| 646 | 673 | } |
| 647 | 674 | }); |
| @@ -1469,7 +1469,7 @@ async function loadPowerUserSettings(settings, data) { | ||
| 1469 | 1469 | $('#auto_swipe_minimum_length').val(power_user.auto_swipe_minimum_length); |
| 1470 | 1470 | $('#auto_swipe_blacklist').val(power_user.auto_swipe_blacklist.join(', ')); |
| 1471 | 1471 | $('#auto_swipe_blacklist_threshold').val(power_user.auto_swipe_blacklist_threshold); |
| 1472 | 1472 | $('#custom_stopping_strings').valtext(power_user.custom_stopping_strings); |
| 1473 | 1473 | $('#custom_stopping_strings_macro').prop('checked', power_user.custom_stopping_strings_macro); |
| 1474 | 1474 | $('#fuzzy_search_checkbox').prop('checked', power_user.fuzzy_search); |
| 1475 | 1475 | $('#persona_show_notifications').prop('checked', power_user.persona_show_notifications); |
| @@ -1499,7 +1499,7 @@ async function loadPowerUserSettings(settings, data) { | ||
| 1499 | 1499 | $('#waifuMode').prop('checked', power_user.waifuMode); |
| 1500 | 1500 | $('#movingUImode').prop('checked', power_user.movingUI); |
| 1501 | 1501 | $('#noShadowsmode').prop('checked', power_user.noShadows); |
| 1502 | 1502 | $('#start_reply_with').valtext(power_user.user_prompt_bias); |
| 1503 | 1503 | $('#chat-show-reply-prefix-checkbox').prop('checked', power_user.show_user_prompt_bias); |
| 1504 | 1504 | $('#auto_continue_enabled').prop('checked', power_user.auto_continue.enabled); |
| 1505 | 1505 | $('#auto_continue_allow_chat_completions').prop('checked', power_user.auto_continue.allow_chat_completions); |
| @@ -1600,7 +1600,7 @@ async function loadPowerUserSettings(settings, data) { | ||
| 1600 | 1600 | switchReducedMotion(); |
| 1601 | 1601 | switchCompactInputArea(); |
| 1602 | 1602 | reloadMarkdownProcessor(power_user.render_formulas); |
| 1603 | 1603 | await loadInstructMode(data); |
| 1604 | 1604 | await loadContextSettings(); |
| 1605 | 1605 | loadMaxContextUnlocked(); |
| 1606 | 1606 | switchWaifuMode(); |
| @@ -1747,13 +1747,14 @@ async function loadContextSettings() { | ||
| 1747 | 1747 | if (control.isCheckbox) { |
| 1748 | 1748 | $element.prop('checked', power_user.context[control.property]); |
| 1749 | 1749 | } else { |
| 1750 | 1750 | $element[0].val(innerText = power_user.context[control.property]); |
| 1751 | 1751 | } |
| 1752 | + console.log(`Setting ${$element.prop('id')} to ${power_user.context[control.property]}`); | |
| 1752 | 1753 | |
| 1753 | 1754 | // If the setting already exists, no need to duplicate it |
| 1754 | 1755 | // TODO: Maybe check the power_user object for the setting instead of a flag? |
| 1755 | 1756 | $element.on('input keyup', async function () { |
| 1756 | 1757 | const value = control.isCheckbox ? !!$(this).prop('checked') : $(this)[0].val()innerText; |
| 1757 | 1758 | if (control.isGlobalSetting) { |
| 1758 | 1759 | power_user[control.property] = value; |
| 1759 | 1760 | } else { |
| @@ -1761,9 +1762,6 @@ async function loadContextSettings() { | ||
| 1761 | 1762 | } |
| 1762 | 1763 | |
| 1763 | 1764 | saveSettingsDebounced(); |
| 1764 | - if (!control.isCheckbox) { | |
| 1765 | - await resetScrollHeight($element); | |
| 1766 | - } | |
| 1767 | 1765 | }); |
| 1768 | 1766 | }); |
| 1769 | 1767 | |
| @@ -1777,7 +1775,7 @@ async function loadContextSettings() { | ||
| 1777 | 1775 | }); |
| 1778 | 1776 | |
| 1779 | 1777 | $('#context_presets').on('change', function () { |
| 1780 | 1778 | const name = String($(this).find(':selected').valtext()); |
| 1781 | 1779 | const preset = context_presets.find(x => x.name === name); |
| 1782 | 1780 | |
| 1783 | 1781 | if (!preset) { |
| @@ -1802,9 +1800,8 @@ async function loadContextSettings() { | ||
| 1802 | 1800 | .prop('checked', control.isGlobalSetting ? power_user[control.property] : power_user.context[control.property]) |
| 1803 | 1801 | .trigger('input'); |
| 1804 | 1802 | } else { |
| 1805 | - $element | |
| 1803 | + $element[0].innerText = (control.isGlobalSetting ? power_user[control.property] : power_user.context[control.property]) | |
| 1806 | - .val(control.isGlobalSetting ? power_user[control.property] : power_user.context[control.property]) | |
| 1804 | + $element.trigger('input'); | |
| 1807 | - .trigger('input'); | |
| 1808 | 1805 | } |
| 1809 | 1806 | } |
| 1810 | 1807 | }); |
| @@ -3106,7 +3103,7 @@ $(document).ready(() => { | ||
| 3106 | 3103 | }); |
| 3107 | 3104 | |
| 3108 | 3105 | $('#start_reply_with').on('input', function () { |
| 3109 | 3106 | power_user.user_prompt_bias = String($(this)[0].val()innerText); |
| 3110 | 3107 | saveSettingsDebounced(); |
| 3111 | 3108 | }); |
| 3112 | 3109 | |
| @@ -3638,7 +3635,7 @@ $(document).ready(() => { | ||
| 3638 | 3635 | }); |
| 3639 | 3636 | |
| 3640 | 3637 | $('#custom_stopping_strings').on('input', function () { |
| 3641 | 3638 | power_user.custom_stopping_strings = String($(this)[0].val(innerText).trim(); |
| 3642 | 3639 | saveSettingsDebounced(); |
| 3643 | 3640 | }); |
| 3644 | 3641 | |
| @@ -36,6 +36,8 @@ export const enumIcons = { | ||
| 36 | 36 | |
| 37 | 37 | true: '✔️', |
| 38 | 38 | false: '❌', |
| 39 | + null: '🚫', | |
| 40 | + undefined: '❓', | |
| 39 | 41 | |
| 40 | 42 | // Value types |
| 41 | 43 | boolean: '🔲', |
| @@ -230,4 +232,19 @@ export const commonEnumProviders = { | ||
| 230 | 232 | enumTypes.enum, '💉'); |
| 231 | 233 | }); |
| 232 | 234 | }, |
| 235 | + | |
| 236 | + /** | |
| 237 | + * Gets somewhat recognizable STscript types. | |
| 238 | + * | |
| 239 | + * @returns {SlashCommandEnumValue[]} | |
| 240 | + */ | |
| 241 | + types: () => [ | |
| 242 | + new SlashCommandEnumValue('string', null, enumTypes.type, enumIcons.string), | |
| 243 | + new SlashCommandEnumValue('number', null, enumTypes.type, enumIcons.number), | |
| 244 | + new SlashCommandEnumValue('boolean', null, enumTypes.type, enumIcons.boolean), | |
| 245 | + new SlashCommandEnumValue('array', null, enumTypes.type, enumIcons.array), | |
| 246 | + new SlashCommandEnumValue('object', null, enumTypes.type, enumIcons.dictionary), | |
| 247 | + new SlashCommandEnumValue('null', null, enumTypes.type, enumIcons.null), | |
| 248 | + new SlashCommandEnumValue('undefined', null, enumTypes.type, enumIcons.undefined), | |
| 249 | + ], | |
| 233 | 250 | }; |
| @@ -1,4 +1,5 @@ | ||
| 1 | 1 | import { SlashCommandClosure } from './SlashCommandClosure.js'; |
| 2 | +import { convertValueType } from '../utils.js'; | |
| 2 | 3 | |
| 3 | 4 | export class SlashCommandScope { |
| 4 | 5 | /**@type {string[]}*/ variableNames = []; |
| @@ -55,7 +56,7 @@ export class SlashCommandScope { | ||
| 55 | 56 | if (this.existsVariableInScope(key)) throw new SlashCommandScopeVariableExistsError(`Variable named "${key}" already exists.`); |
| 56 | 57 | this.variables[key] = value; |
| 57 | 58 | } |
| 58 | 59 | setVariable(key, value, index = null, type = null) { |
| 59 | 60 | if (this.existsVariableInScope(key)) { |
| 60 | 61 | if (index !== null && index !== undefined) { |
| 61 | 62 | let v = this.variables[key]; |
| @@ -63,13 +64,13 @@ export class SlashCommandScope { | ||
| 63 | 64 | v = JSON.parse(v); |
| 64 | 65 | const numIndex = Number(index); |
| 65 | 66 | if (Number.isNaN(numIndex)) { |
| 66 | 67 | v[index] = convertValueType(value, type); |
| 67 | 68 | } else { |
| 68 | 69 | v[numIndex] = convertValueType(value, type); |
| 69 | 70 | } |
| 70 | 71 | v = JSON.stringify(v); |
| 71 | 72 | } catch { |
| 72 | 73 | v[index] = convertValueType(value, type); |
| 73 | 74 | } |
| 74 | 75 | this.variables[key] = v; |
| 75 | 76 | } else { |
| @@ -78,7 +79,7 @@ export class SlashCommandScope { | ||
| 78 | 79 | return value; |
| 79 | 80 | } |
| 80 | 81 | if (this.parent) { |
| 81 | 82 | return this.parent.setVariable(key, value, index, type); |
| 82 | 83 | } |
| 83 | 84 | throw new SlashCommandScopeVariableNotFoundError(`No such variable: "${key}"`); |
| 84 | 85 | } |
| @@ -1,4 +1,3 @@ | ||
| 1 | -import { eventSource, event_types } from '../script.js'; | |
| 2 | 1 | import { power_user } from './power-user.js'; |
| 3 | 2 | import { delay } from './utils.js'; |
| 4 | 3 | |
| @@ -268,7 +267,6 @@ export class SmoothEventSourceStream extends EventSourceStream { | ||
| 268 | 267 | hasFocus && await delay(getDelay(lastStr)); |
| 269 | 268 | controller.enqueue(new MessageEvent(event.type, { data: JSON.stringify(parsed.data) })); |
| 270 | 269 | lastStr = parsed.chunk; |
| 271 | - hasFocus && await eventSource.emit(event_types.SMOOTH_STREAM_TOKEN_RECEIVED, parsed.chunk); | |
| 272 | 270 | } |
| 273 | 271 | } catch (error) { |
| 274 | 272 | console.debug('Smooth Streaming parsing error', error); |
| @@ -4,6 +4,7 @@ import { isMobile } from './RossAscends-mods.js'; | ||
| 4 | 4 | import { collapseNewlines } from './power-user.js'; |
| 5 | 5 | import { debounce_timeout } from './constants.js'; |
| 6 | 6 | import { Popup, POPUP_RESULT, POPUP_TYPE } from './popup.js'; |
| 7 | +import { SlashCommandClosure } from './slash-commands/SlashCommandClosure.js'; | |
| 7 | 8 | |
| 8 | 9 | /** |
| 9 | 10 | * Pagination status string template. |
| @@ -34,6 +35,74 @@ export function isValidUrl(value) { | ||
| 34 | 35 | } |
| 35 | 36 | |
| 36 | 37 | /** |
| 38 | + * Converts string to a value of a given type. Includes pythonista-friendly aliases. | |
| 39 | + * @param {string|SlashCommandClosure} value String value | |
| 40 | + * @param {string} type Type to convert to | |
| 41 | + * @returns {any} Converted value | |
| 42 | + */ | |
| 43 | +export function convertValueType(value, type) { | |
| 44 | + if (value instanceof SlashCommandClosure || typeof type !== 'string') { | |
| 45 | + return value; | |
| 46 | + } | |
| 47 | + | |
| 48 | + switch (type.trim().toLowerCase()) { | |
| 49 | + case 'string': | |
| 50 | + case 'str': | |
| 51 | + return String(value); | |
| 52 | + | |
| 53 | + case 'null': | |
| 54 | + return null; | |
| 55 | + | |
| 56 | + case 'undefined': | |
| 57 | + case 'none': | |
| 58 | + return undefined; | |
| 59 | + | |
| 60 | + case 'number': | |
| 61 | + return Number(value); | |
| 62 | + | |
| 63 | + case 'int': | |
| 64 | + return parseInt(value, 10); | |
| 65 | + | |
| 66 | + case 'float': | |
| 67 | + return parseFloat(value); | |
| 68 | + | |
| 69 | + case 'boolean': | |
| 70 | + case 'bool': | |
| 71 | + return isTrueBoolean(value); | |
| 72 | + | |
| 73 | + case 'list': | |
| 74 | + case 'array': | |
| 75 | + try { | |
| 76 | + const parsedArray = JSON.parse(value); | |
| 77 | + if (Array.isArray(parsedArray)) { | |
| 78 | + return parsedArray; | |
| 79 | + } | |
| 80 | + // The value is not an array | |
| 81 | + return []; | |
| 82 | + } catch { | |
| 83 | + return []; | |
| 84 | + } | |
| 85 | + | |
| 86 | + case 'object': | |
| 87 | + case 'dict': | |
| 88 | + case 'dictionary': | |
| 89 | + try { | |
| 90 | + const parsedObject = JSON.parse(value); | |
| 91 | + if (typeof parsedObject === 'object') { | |
| 92 | + return parsedObject; | |
| 93 | + } | |
| 94 | + // The value is not an object | |
| 95 | + return {}; | |
| 96 | + } catch { | |
| 97 | + return {}; | |
| 98 | + } | |
| 99 | + | |
| 100 | + default: | |
| 101 | + return value; | |
| 102 | + } | |
| 103 | +} | |
| 104 | + | |
| 105 | +/** | |
| 37 | 106 | * Parses ranges like 10-20 or 10. |
| 38 | 107 | * Range is inclusive. Start must be less than end. |
| 39 | 108 | * Returns null if invalid. |
| @@ -11,7 +11,7 @@ import { commonEnumProviders, enumIcons } from './slash-commands/SlashCommandCom | ||
| 11 | 11 | import { SlashCommandEnumValue, enumTypes } from './slash-commands/SlashCommandEnumValue.js'; |
| 12 | 12 | import { PARSER_FLAG, SlashCommandParser } from './slash-commands/SlashCommandParser.js'; |
| 13 | 13 | import { SlashCommandScope } from './slash-commands/SlashCommandScope.js'; |
| 14 | 14 | import { isFalseBoolean, convertValueType } from './utils.js'; |
| 15 | 15 | |
| 16 | 16 | /** @typedef {import('./slash-commands/SlashCommandParser.js').NamedArguments} NamedArguments */ |
| 17 | 17 | /** @typedef {import('./slash-commands/SlashCommand.js').UnnamedArguments} UnnamedArguments */ |
| @@ -57,12 +57,12 @@ function setLocalVariable(name, value, args = {}) { | ||
| 57 | 57 | if (localVariable === null) { |
| 58 | 58 | localVariable = {}; |
| 59 | 59 | } |
| 60 | 60 | localVariable[args.index] = convertValueType(value, args.as); |
| 61 | 61 | } else { |
| 62 | 62 | if (localVariable === null) { |
| 63 | 63 | localVariable = []; |
| 64 | 64 | } |
| 65 | 65 | localVariable[numIndex] = convertValueType(value, args.as); |
| 66 | 66 | } |
| 67 | 67 | chat_metadata.variables[name] = JSON.stringify(localVariable); |
| 68 | 68 | } catch { |
| @@ -106,12 +106,12 @@ function setGlobalVariable(name, value, args = {}) { | ||
| 106 | 106 | if (globalVariable === null) { |
| 107 | 107 | globalVariable = {}; |
| 108 | 108 | } |
| 109 | 109 | globalVariable[args.index] = convertValueType(value, args.as); |
| 110 | 110 | } else { |
| 111 | 111 | if (globalVariable === null) { |
| 112 | 112 | globalVariable = []; |
| 113 | 113 | } |
| 114 | 114 | globalVariable[numIndex] = convertValueType(value, args.as); |
| 115 | 115 | } |
| 116 | 116 | extension_settings.variables.global[name] = JSON.stringify(globalVariable); |
| 117 | 117 | } catch { |
| @@ -667,6 +667,7 @@ function parseNumericSeries(value, scope = null) { | ||
| 667 | 667 | } |
| 668 | 668 | |
| 669 | 669 | function performOperation(value, operation, singleOperand = false, scope = null) { |
| 670 | + function getResult() { | |
| 670 | 671 | if (!value) { |
| 671 | 672 | return 0; |
| 672 | 673 | } |
| @@ -686,6 +687,10 @@ function performOperation(value, operation, singleOperand = false, scope = null) | ||
| 686 | 687 | return result; |
| 687 | 688 | } |
| 688 | 689 | |
| 690 | + const result = getResult(); | |
| 691 | + return String(result); | |
| 692 | +} | |
| 693 | + | |
| 689 | 694 | function addValuesCallback(args, value) { |
| 690 | 695 | return performOperation(value, (array) => array.reduce((a, b) => a + b, 0), false, args._scope); |
| 691 | 696 | } |
| @@ -836,7 +841,7 @@ function varCallback(args, value) { | ||
| 836 | 841 | if (typeof key != 'string') throw new Error('Key must be a string'); |
| 837 | 842 | if (args._hasUnnamedArgument) { |
| 838 | 843 | const val = typeof value[0] == 'string' ? value.join(' ') : value[0]; |
| 839 | 844 | args._scope.setVariable(key, val, args.index, args.as); |
| 840 | 845 | return val; |
| 841 | 846 | } else { |
| 842 | 847 | return args._scope.getVariable(key, args.index); |
| @@ -846,7 +851,7 @@ function varCallback(args, value) { | ||
| 846 | 851 | if (typeof key != 'string') throw new Error('Key must be a string'); |
| 847 | 852 | if (value.length > 0) { |
| 848 | 853 | const val = typeof value[0] == 'string' ? value.join(' ') : value[0]; |
| 849 | 854 | args._scope.setVariable(key, val, args.index, args.as); |
| 850 | 855 | return val; |
| 851 | 856 | } else { |
| 852 | 857 | return args._scope.getVariable(key, args.index); |
| @@ -901,6 +906,14 @@ export function registerVariableCommands() { | ||
| 901 | 906 | new SlashCommandNamedArgument( |
| 902 | 907 | 'index', 'list index', [ARGUMENT_TYPE.NUMBER, ARGUMENT_TYPE.STRING], false, |
| 903 | 908 | ), |
| 909 | + SlashCommandNamedArgument.fromProps({ | |
| 910 | + name: 'as', | |
| 911 | + description: 'change the type of the value when used with index', | |
| 912 | + forceEnum: true, | |
| 913 | + enumProvider: commonEnumProviders.types, | |
| 914 | + isRequired: false, | |
| 915 | + defaultValue: 'string', | |
| 916 | + }), | |
| 904 | 917 | ], |
| 905 | 918 | unnamedArgumentList: [ |
| 906 | 919 | new SlashCommandArgument( |
| @@ -910,6 +923,7 @@ export function registerVariableCommands() { | ||
| 910 | 923 | helpString: ` |
| 911 | 924 | <div> |
| 912 | 925 | Set a local variable value and pass it down the pipe. The <code>index</code> argument is optional. |
| 926 | + To convert the value to a specific JSON type when using <code>index</code>, use the <code>as</code> argument. | |
| 913 | 927 | </div> |
| 914 | 928 | <div> |
| 915 | 929 | <strong>Example:</strong> |
| @@ -917,6 +931,9 @@ export function registerVariableCommands() { | ||
| 917 | 931 | <li> |
| 918 | 932 | <pre><code class="language-stscript">/setvar key=color green</code></pre> |
| 919 | 933 | </li> |
| 934 | + <li> | |
| 935 | + <pre><code class="language-stscript">/setvar key=ages index=John as=number 21</code></pre> | |
| 936 | + </li> | |
| 920 | 937 | </ul> |
| 921 | 938 | </div> |
| 922 | 939 | `, |
| @@ -1015,6 +1032,14 @@ export function registerVariableCommands() { | ||
| 1015 | 1032 | new SlashCommandNamedArgument( |
| 1016 | 1033 | 'index', 'list index', [ARGUMENT_TYPE.NUMBER, ARGUMENT_TYPE.STRING], false, |
| 1017 | 1034 | ), |
| 1035 | + SlashCommandNamedArgument.fromProps({ | |
| 1036 | + name: 'as', | |
| 1037 | + description: 'change the type of the value when used with index', | |
| 1038 | + forceEnum: true, | |
| 1039 | + enumProvider: commonEnumProviders.types, | |
| 1040 | + isRequired: false, | |
| 1041 | + defaultValue: 'string', | |
| 1042 | + }), | |
| 1018 | 1043 | ], |
| 1019 | 1044 | unnamedArgumentList: [ |
| 1020 | 1045 | new SlashCommandArgument( |
| @@ -1024,6 +1049,7 @@ export function registerVariableCommands() { | ||
| 1024 | 1049 | helpString: ` |
| 1025 | 1050 | <div> |
| 1026 | 1051 | Set a global variable value and pass it down the pipe. The <code>index</code> argument is optional. |
| 1052 | + To convert the value to a specific JSON type when using <code>index</code>, use the <code>as</code> argument. | |
| 1027 | 1053 | </div> |
| 1028 | 1054 | <div> |
| 1029 | 1055 | <strong>Example:</strong> |
| @@ -1031,6 +1057,9 @@ export function registerVariableCommands() { | ||
| 1031 | 1057 | <li> |
| 1032 | 1058 | <pre><code class="language-stscript">/setglobalvar key=color green</code></pre> |
| 1033 | 1059 | </li> |
| 1060 | + <li> | |
| 1061 | + <pre><code class="language-stscript">/setglobalvar key=ages index=John as=number 21</code></pre> | |
| 1062 | + </li> | |
| 1034 | 1063 | </ul> |
| 1035 | 1064 | </div> |
| 1036 | 1065 | `, |
| @@ -2030,6 +2059,14 @@ export function registerVariableCommands() { | ||
| 2030 | 2059 | false, // isRequired |
| 2031 | 2060 | false, // acceptsMultiple |
| 2032 | 2061 | ), |
| 2062 | + SlashCommandNamedArgument.fromProps({ | |
| 2063 | + name: 'as', | |
| 2064 | + description: 'change the type of the value when used with index', | |
| 2065 | + forceEnum: true, | |
| 2066 | + enumProvider: commonEnumProviders.types, | |
| 2067 | + isRequired: false, | |
| 2068 | + defaultValue: 'string', | |
| 2069 | + }), | |
| 2033 | 2070 | ], |
| 2034 | 2071 | unnamedArgumentList: [ |
| 2035 | 2072 | SlashCommandArgument.fromProps({ |
| @@ -2049,7 +2086,8 @@ export function registerVariableCommands() { | ||
| 2049 | 2086 | splitUnnamedArgumentCount: 1, |
| 2050 | 2087 | helpString: ` |
| 2051 | 2088 | <div> |
| 2052 | - Get or set a variable. | |
| 2089 | + Get or set a variable. Use <code>index</code> to access elements of a JSON-serialized list or dictionary. | |
| 2090 | + To convert the value to a specific JSON type when using with <code>index</code>, use the <code>as</code> argument. | |
| 2053 | 2091 | </div> |
| 2054 | 2092 | <div> |
| 2055 | 2093 | <strong>Examples:</strong> |
| @@ -2060,6 +2098,9 @@ export function registerVariableCommands() { | ||
| 2060 | 2098 | <li> |
| 2061 | 2099 | <pre><code class="language-stscript">/let x foo | /var key=x foo bar | /var x | /echo</code></pre> |
| 2062 | 2100 | </li> |
| 2101 | + <li> | |
| 2102 | + <pre><code class="language-stscript">/let x {} | /var index=cool as=number x 1337 | /echo {{var::x}}</code></pre> | |
| 2103 | + </li> | |
| 2063 | 2104 | </ul> |
| 2064 | 2105 | </div> |
| 2065 | 2106 | `, |
| @@ -1602,6 +1602,7 @@ body[data-stscript-style] .hljs.language-stscript { | ||
| 1602 | 1602 | .hljs-pipe { |
| 1603 | 1603 | color: var(--ac-style-color-punctuation); |
| 1604 | 1604 | } |
| 1605 | + | |
| 1605 | 1606 | .hljs-pipebreak { |
| 1606 | 1607 | color: var(--ac-style-color-type); |
| 1607 | 1608 | } |
| @@ -1695,6 +1696,7 @@ body[data-stscript-style] .hljs.language-stscript { | ||
| 1695 | 1696 | background-color: var(--ac-color-selectedBackground); |
| 1696 | 1697 | color: var(--ac-color-selectedText); |
| 1697 | 1698 | } |
| 1699 | + | |
| 1698 | 1700 | &.selected.not-selectable>* { |
| 1699 | 1701 | background-color: var(--ac-color-notSelectableBackground); |
| 1700 | 1702 | color: var(--ac-color-notSelectableText); |
| @@ -1780,7 +1782,9 @@ body[data-stscript-style] .hljs.language-stscript { | ||
| 1780 | 1782 | display: flex; |
| 1781 | 1783 | gap: 0.5em; |
| 1782 | 1784 | } |
| 1783 | - > .head > .name, > .name { | |
| 1785 | + | |
| 1786 | + >.head>.name, | |
| 1787 | + >.name { | |
| 1784 | 1788 | flex: 1 1 auto; |
| 1785 | 1789 | font-weight: bold; |
| 1786 | 1790 | color: var(--ac-color-text); |
| @@ -1790,20 +1794,25 @@ body[data-stscript-style] .hljs.language-stscript { | ||
| 1790 | 1794 | text-decoration: 1px dotted underline; |
| 1791 | 1795 | } |
| 1792 | 1796 | } |
| 1797 | + | |
| 1793 | 1798 | >.head>.source { |
| 1794 | 1799 | padding: 0 0.5em; |
| 1795 | 1800 | cursor: help; |
| 1796 | 1801 | display: flex; |
| 1797 | 1802 | align-items: center; |
| 1798 | 1803 | gap: 0.5em; |
| 1804 | + | |
| 1799 | 1805 | &.isThirdParty.isExtension { |
| 1800 | 1806 | color: #F89406; |
| 1801 | 1807 | } |
| 1808 | + | |
| 1802 | 1809 | &.isCore { |
| 1803 | 1810 | color: transparent; |
| 1811 | + | |
| 1804 | 1812 | &.isExtension { |
| 1805 | 1813 | color: #51A351; |
| 1806 | 1814 | } |
| 1815 | + | |
| 1807 | 1816 | &:after { |
| 1808 | 1817 | content: ''; |
| 1809 | 1818 | order: -1; |
| @@ -2605,7 +2614,8 @@ select option:not(:checked) { | ||
| 2605 | 2614 | color: var(--golden) !important; |
| 2606 | 2615 | } |
| 2607 | 2616 | |
| 2608 | 2617 | .world_set {, |
| 2618 | +.toggleEnabled { | |
| 2609 | 2619 | color: var(--active) !important; |
| 2610 | 2620 | } |
| 2611 | 2621 | |
| @@ -5398,6 +5408,7 @@ body:not(.movingUI) .drawer-content.maximized { | ||
| 5398 | 5408 | .popup:has(.faPicker) { |
| 5399 | 5409 | /* Fix height for fa picker popup, otherwise search is making it resize weirdly */ |
| 5400 | 5410 | height: 70%; |
| 5411 | + | |
| 5401 | 5412 | .popup-content { |
| 5402 | 5413 | display: flex; |
| 5403 | 5414 | flex-direction: column; |
| @@ -5407,7 +5418,8 @@ body:not(.movingUI) .drawer-content.maximized { | ||
| 5407 | 5418 | .faPicker-container { |
| 5408 | 5419 | display: flex; |
| 5409 | 5420 | flex-direction: column; |
| 5410 | 5421 | overflow: hidden;; |
| 5422 | + ; | |
| 5411 | 5423 | } |
| 5412 | 5424 | |
| 5413 | 5425 | .faQuery-container { |
| @@ -5429,6 +5441,7 @@ body:not(.movingUI) .drawer-content.maximized { | ||
| 5429 | 5441 | padding: 0.25em; |
| 5430 | 5442 | width: unset; |
| 5431 | 5443 | box-sizing: content-box; |
| 5444 | + | |
| 5432 | 5445 | &.hidden { |
| 5433 | 5446 | display: none; |
| 5434 | 5447 | } |
| @@ -5440,3 +5453,7 @@ body:not(.movingUI) .drawer-content.maximized { | ||
| 5440 | 5453 | color: var(--SmartThemeBodyColor); |
| 5441 | 5454 | opacity: 0.7; |
| 5442 | 5455 | } |
| 5456 | + | |
| 5457 | +#advanced-formatting-button div[contenteditable] { | |
| 5458 | + overflow-wrap: anywhere; | |
| 5459 | +} | |