From 4d270d94fa2f1680e4e4c5db3afa367d47662598 Mon Sep 17 00:00:00 2001 From: RealBeepMcJeep Date: Tue, 29 Aug 2023 13:50:07 -0700 Subject: [PATCH 01/68] initial vscode jsconfig.json for type checking server.js --- jsconfig.json | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 jsconfig.json diff --git a/jsconfig.json b/jsconfig.json new file mode 100644 index 000000000..790faa9d6 --- /dev/null +++ b/jsconfig.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "module": "ESNext", + "target": "ESNext", + "moduleResolution": "node", + "strictNullChecks": true, + "strictFunctionTypes": true, + "checkJs": true, + "allowUmdGlobalAccess": true, + "allowSyntheticDefaultImports": true + }, + "exclude": [ + "node_modules", + "**/node_modules/*" + ] +} \ No newline at end of file From 2bd645e271486aa00aa03f425c7ee339905de7f3 Mon Sep 17 00:00:00 2001 From: RealBeepMcJeep Date: Tue, 29 Aug 2023 14:05:18 -0700 Subject: [PATCH 02/68] move child_process import to top --- jsconfig.json | 16 ++++++++++++++++ server.js | 9 +++++++-- 2 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 jsconfig.json diff --git a/jsconfig.json b/jsconfig.json new file mode 100644 index 000000000..790faa9d6 --- /dev/null +++ b/jsconfig.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "module": "ESNext", + "target": "ESNext", + "moduleResolution": "node", + "strictNullChecks": true, + "strictFunctionTypes": true, + "checkJs": true, + "allowUmdGlobalAccess": true, + "allowSyntheticDefaultImports": true + }, + "exclude": [ + "node_modules", + "**/node_modules/*" + ] +} \ No newline at end of file diff --git a/server.js b/server.js index ef435fd55..6eb6ae349 100644 --- a/server.js +++ b/server.js @@ -1,5 +1,9 @@ #!/usr/bin/env node +// native node modules +const child_process = require('child_process') + + createDefaultFiles(); function createDefaultFiles() { @@ -838,11 +842,11 @@ function getVersion() { const pkgJson = require('./package.json'); pkgVersion = pkgJson.version; if (!process.pkg && commandExistsSync('git')) { - gitRevision = require('child_process') + gitRevision = child_process .execSync('git rev-parse --short HEAD', { cwd: process.cwd(), stdio: ['ignore', 'pipe', 'ignore'] }) .toString().trim(); - gitBranch = require('child_process') + gitBranch = child_process .execSync('git rev-parse --abbrev-ref HEAD', { cwd: process.cwd(), stdio: ['ignore', 'pipe', 'ignore'] }) .toString().trim(); } @@ -1855,6 +1859,7 @@ app.post("/getstatus_novelai", jsonParser, function (request, response_getstatus data: data, headers: { "Content-Type": "application/json", "Authorization": "Bearer " + api_key_novel } }; + client.get(api_novelai + "/user/subscription", args, function (data, response) { if (response.statusCode == 200) { //console.log(data); From 8d5eb062e6894d44a2732356121029f388c2b154 Mon Sep 17 00:00:00 2001 From: RealBeepMcJeep Date: Tue, 29 Aug 2023 14:06:37 -0700 Subject: [PATCH 03/68] move fs and path imports to top --- server.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/server.js b/server.js index 6eb6ae349..78d1e81d1 100644 --- a/server.js +++ b/server.js @@ -2,13 +2,12 @@ // native node modules const child_process = require('child_process') - +const fs = require('fs'); +const path = require('path'); createDefaultFiles(); function createDefaultFiles() { - const fs = require('fs'); - const path = require('path'); const files = { settings: 'public/settings.json', bg_load: 'public/css/bg_load.css', @@ -56,7 +55,6 @@ const cliArguments = yargs(hideBin(process.argv)) }).argv; // change all relative paths -const path = require('path'); const directory = process.pkg ? path.dirname(process.execPath) : __dirname; console.log(process.pkg ? 'Running from binary' : 'Running from source'); process.chdir(directory); @@ -70,7 +68,6 @@ const simpleGit = require('simple-git'); app.use(compression()); app.use(responseTime()); -const fs = require('fs'); const writeFileAtomicSync = require('write-file-atomic').sync; const readline = require('readline'); const open = require('open'); From 288378919a2051ea141fd4471ce2ce41d5cb256c Mon Sep 17 00:00:00 2001 From: RealBeepMcJeep Date: Tue, 29 Aug 2023 14:10:40 -0700 Subject: [PATCH 04/68] move express imports to top --- server.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/server.js b/server.js index 78d1e81d1..436762435 100644 --- a/server.js +++ b/server.js @@ -5,6 +5,12 @@ const child_process = require('child_process') const fs = require('fs'); const path = require('path'); +// express related library imports +const express = require('express'); +const compression = require('compression'); +const responseTime = require('response-time'); +const multer = require("multer"); + createDefaultFiles(); function createDefaultFiles() { @@ -59,10 +65,9 @@ const directory = process.pkg ? path.dirname(process.execPath) : __dirname; console.log(process.pkg ? 'Running from binary' : 'Running from source'); process.chdir(directory); -const express = require('express'); -const compression = require('compression'); + const app = express(); -const responseTime = require('response-time'); + const simpleGit = require('simple-git'); app.use(compression()); @@ -72,7 +77,6 @@ const writeFileAtomicSync = require('write-file-atomic').sync; const readline = require('readline'); const open = require('open'); -const multer = require("multer"); const http = require("http"); const https = require('https'); const basicAuthMiddleware = require('./src/middleware/basicAuthMiddleware'); From 918aba3eb6b95f46acc07023daa07f77ceb1c95a Mon Sep 17 00:00:00 2001 From: RealBeepMcJeep Date: Tue, 29 Aug 2023 14:12:47 -0700 Subject: [PATCH 05/68] group image processing imports at top --- server.js | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/server.js b/server.js index 436762435..d2b188590 100644 --- a/server.js +++ b/server.js @@ -11,6 +11,15 @@ const compression = require('compression'); const responseTime = require('response-time'); const multer = require("multer"); +// image processing related library imports +const extract = require('png-chunks-extract'); +const encode = require('png-chunks-encode'); +const PNGtext = require('png-chunk-text'); +const jimp = require('jimp'); +const mime = require('mime-types'); +const exif = require('piexifjs'); +const webp = require('webp-converter'); + createDefaultFiles(); function createDefaultFiles() { @@ -81,21 +90,13 @@ const http = require("http"); const https = require('https'); const basicAuthMiddleware = require('./src/middleware/basicAuthMiddleware'); const contentManager = require('./src/content-manager'); -const extract = require('png-chunks-extract'); -const encode = require('png-chunks-encode'); -const PNGtext = require('png-chunk-text'); -const jimp = require('jimp'); const sanitize = require('sanitize-filename'); -const mime = require('mime-types'); - const cookieParser = require('cookie-parser'); const crypto = require('crypto'); const ipaddr = require('ipaddr.js'); const json5 = require('json5'); -const exif = require('piexifjs'); -const webp = require('webp-converter'); const DeviceDetector = require("device-detector-js"); const { TextEncoder, TextDecoder } = require('util'); const utf8Encode = new TextEncoder(); From fc59b20f36530c20678fee84f27fd23bfd774054 Mon Sep 17 00:00:00 2001 From: RealBeepMcJeep Date: Tue, 29 Aug 2023 14:16:39 -0700 Subject: [PATCH 06/68] cli/fs related library import grouping --- server.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/server.js b/server.js index d2b188590..3dc04ceee 100644 --- a/server.js +++ b/server.js @@ -5,6 +5,13 @@ const child_process = require('child_process') const fs = require('fs'); const path = require('path'); +// cli/fs related library imports +const yargs = require('yargs/yargs'); +const { hideBin } = require('yargs/helpers'); +const simpleGit = require('simple-git'); +const writeFileAtomicSync = require('write-file-atomic').sync; +const sanitize = require('sanitize-filename'); + // express related library imports const express = require('express'); const compression = require('compression'); @@ -42,8 +49,6 @@ function createDefaultFiles() { } } -const yargs = require('yargs/yargs'); -const { hideBin } = require('yargs/helpers'); const net = require("net"); // work around a node v20 bug: https://github.com/nodejs/node/issues/47822#issuecomment-1564708870 if (net.setDefaultAutoSelectFamily) { @@ -77,12 +82,12 @@ process.chdir(directory); const app = express(); -const simpleGit = require('simple-git'); + app.use(compression()); app.use(responseTime()); -const writeFileAtomicSync = require('write-file-atomic').sync; + const readline = require('readline'); const open = require('open'); @@ -91,7 +96,7 @@ const https = require('https'); const basicAuthMiddleware = require('./src/middleware/basicAuthMiddleware'); const contentManager = require('./src/content-manager'); -const sanitize = require('sanitize-filename'); + const cookieParser = require('cookie-parser'); const crypto = require('crypto'); const ipaddr = require('ipaddr.js'); From c0b1ea5f4c6c65ca6bc7149c396a1fbc69d5bf1e Mon Sep 17 00:00:00 2001 From: RealBeepMcJeep Date: Tue, 29 Aug 2023 14:20:37 -0700 Subject: [PATCH 07/68] grouping native node imports --- server.js | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/server.js b/server.js index 3dc04ceee..b7a223497 100644 --- a/server.js +++ b/server.js @@ -2,8 +2,13 @@ // native node modules const child_process = require('child_process') +const crypto = require('crypto'); const fs = require('fs'); +const http = require("http"); +const https = require('https'); const path = require('path'); +const readline = require('readline'); +const { TextEncoder, TextDecoder } = require('util'); // cli/fs related library imports const yargs = require('yargs/yargs'); @@ -79,31 +84,21 @@ const directory = process.pkg ? path.dirname(process.execPath) : __dirname; console.log(process.pkg ? 'Running from binary' : 'Running from source'); process.chdir(directory); - const app = express(); - - - app.use(compression()); app.use(responseTime()); - -const readline = require('readline'); const open = require('open'); -const http = require("http"); -const https = require('https'); const basicAuthMiddleware = require('./src/middleware/basicAuthMiddleware'); const contentManager = require('./src/content-manager'); - const cookieParser = require('cookie-parser'); -const crypto = require('crypto'); const ipaddr = require('ipaddr.js'); const json5 = require('json5'); const DeviceDetector = require("device-detector-js"); -const { TextEncoder, TextDecoder } = require('util'); + const utf8Encode = new TextEncoder(); const commandExistsSync = require('command-exists').sync; From 9087736835b0a87bc08d6155d46ddcecdaacca39 Mon Sep 17 00:00:00 2001 From: RealBeepMcJeep Date: Tue, 29 Aug 2023 14:23:53 -0700 Subject: [PATCH 08/68] move and organize additional imports --- server.js | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/server.js b/server.js index b7a223497..30b1b603f 100644 --- a/server.js +++ b/server.js @@ -11,25 +11,28 @@ const readline = require('readline'); const { TextEncoder, TextDecoder } = require('util'); // cli/fs related library imports -const yargs = require('yargs/yargs'); -const { hideBin } = require('yargs/helpers'); +const commandExistsSync = require('command-exists').sync; +const sanitize = require('sanitize-filename'); const simpleGit = require('simple-git'); const writeFileAtomicSync = require('write-file-atomic').sync; -const sanitize = require('sanitize-filename'); +const yargs = require('yargs/yargs'); +const { hideBin } = require('yargs/helpers'); -// express related library imports +// express/net related library imports const express = require('express'); const compression = require('compression'); -const responseTime = require('response-time'); +const cookieParser = require('cookie-parser'); const multer = require("multer"); +const responseTime = require('response-time'); +const DeviceDetector = require("device-detector-js"); // image processing related library imports -const extract = require('png-chunks-extract'); +const exif = require('piexifjs'); const encode = require('png-chunks-encode'); -const PNGtext = require('png-chunk-text'); +const extract = require('png-chunks-extract'); const jimp = require('jimp'); const mime = require('mime-types'); -const exif = require('piexifjs'); +const PNGtext = require('png-chunk-text'); const webp = require('webp-converter'); createDefaultFiles(); @@ -93,14 +96,13 @@ const open = require('open'); const basicAuthMiddleware = require('./src/middleware/basicAuthMiddleware'); const contentManager = require('./src/content-manager'); -const cookieParser = require('cookie-parser'); const ipaddr = require('ipaddr.js'); const json5 = require('json5'); -const DeviceDetector = require("device-detector-js"); + const utf8Encode = new TextEncoder(); -const commandExistsSync = require('command-exists').sync; + // impoort from statsHelpers.js const statsHelpers = require('./statsHelpers.js'); From 26e008e907f341a7fc4f3e9c1f0338fad0869784 Mon Sep 17 00:00:00 2001 From: RealBeepMcJeep Date: Tue, 29 Aug 2023 14:26:59 -0700 Subject: [PATCH 09/68] move and organize more imports --- server.js | 42 ++++++++++++++++++++---------------------- 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/server.js b/server.js index 30b1b603f..2ecef5a9f 100644 --- a/server.js +++ b/server.js @@ -12,19 +12,28 @@ const { TextEncoder, TextDecoder } = require('util'); // cli/fs related library imports const commandExistsSync = require('command-exists').sync; +const open = require('open'); const sanitize = require('sanitize-filename'); const simpleGit = require('simple-git'); const writeFileAtomicSync = require('write-file-atomic').sync; const yargs = require('yargs/yargs'); const { hideBin } = require('yargs/helpers'); -// express/net related library imports +// express related library imports const express = require('express'); const compression = require('compression'); const cookieParser = require('cookie-parser'); const multer = require("multer"); const responseTime = require('response-time'); + +// net related library imports +const axios = require('axios'); const DeviceDetector = require("device-detector-js"); +const ipaddr = require('ipaddr.js'); +const ipMatching = require('ip-matching'); +const json5 = require('json5'); +const Client = require('node-rest-client').Client; +const WebSocket = require('ws'); // image processing related library imports const exif = require('piexifjs'); @@ -34,6 +43,16 @@ const jimp = require('jimp'); const mime = require('mime-types'); const PNGtext = require('png-chunk-text'); const webp = require('webp-converter'); +const yauzl = require('yauzl'); + +// tokenizing related library imports +const tiktoken = require('@dqbd/tiktoken'); + +// local library imports +const basicAuthMiddleware = require('./src/middleware/basicAuthMiddleware'); +const characterCardParser = require('./src/character-card-parser.js'); +const contentManager = require('./src/content-manager'); +const statsHelpers = require('./statsHelpers.js'); createDefaultFiles(); @@ -91,23 +110,10 @@ const app = express(); app.use(compression()); app.use(responseTime()); -const open = require('open'); - -const basicAuthMiddleware = require('./src/middleware/basicAuthMiddleware'); -const contentManager = require('./src/content-manager'); - -const ipaddr = require('ipaddr.js'); -const json5 = require('json5'); - - - const utf8Encode = new TextEncoder(); - // impoort from statsHelpers.js -const statsHelpers = require('./statsHelpers.js'); -const characterCardParser = require('./src/character-card-parser.js'); const config = require(path.join(process.cwd(), './config.conf')); const server_port = process.env.SILLY_TAVERN_PORT || config.port; @@ -128,10 +134,6 @@ const enableExtensions = config.enableExtensions; const listen = config.listen; const allowKeysExposure = config.allowKeysExposure; -const axios = require('axios'); -const tiktoken = require('@dqbd/tiktoken'); -const WebSocket = require('ws'); - function getHordeClient() { const AIHorde = require("./src/horde"); const ai_horde = new AIHorde({ @@ -140,10 +142,6 @@ function getHordeClient() { return ai_horde; } -const ipMatching = require('ip-matching'); -const yauzl = require('yauzl'); - -const Client = require('node-rest-client').Client; const client = new Client(); client.on('error', (err) => { From d07779e5da9d4dede5aa8750c0fc1dc7f5ecef4b Mon Sep 17 00:00:00 2001 From: RealBeepMcJeep Date: Tue, 29 Aug 2023 14:28:13 -0700 Subject: [PATCH 10/68] refactor ambiguous "Client" from node-rest-client --- server.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/server.js b/server.js index 2ecef5a9f..559ec3927 100644 --- a/server.js +++ b/server.js @@ -32,7 +32,7 @@ const DeviceDetector = require("device-detector-js"); const ipaddr = require('ipaddr.js'); const ipMatching = require('ip-matching'); const json5 = require('json5'); -const Client = require('node-rest-client').Client; +const RESTClient = require('node-rest-client').Client; const WebSocket = require('ws'); // image processing related library imports @@ -142,9 +142,9 @@ function getHordeClient() { return ai_horde; } -const client = new Client(); +const restClient = new RESTClient(); -client.on('error', (err) => { +restClient.on('error', (err) => { console.error('An error occurred:', err); }); @@ -1862,7 +1862,7 @@ app.post("/getstatus_novelai", jsonParser, function (request, response_getstatus headers: { "Content-Type": "application/json", "Authorization": "Bearer " + api_key_novel } }; - client.get(api_novelai + "/user/subscription", args, function (data, response) { + restClient.get(api_novelai + "/user/subscription", args, function (data, response) { if (response.statusCode == 200) { //console.log(data); response_getstatus_novel.send(data);//data); @@ -3125,7 +3125,7 @@ app.post("/getstatus_openai", jsonParser, function (request, response_getstatus_ ...headers, }, }; - client.get(api_url + "/models", args, function (data, response) { + restClient.get(api_url + "/models", args, function (data, response) { if (response.statusCode == 200) { response_getstatus_openai.send(data); if (request.body.use_openrouter) { @@ -3978,7 +3978,7 @@ async function postAsync(url, args) { function getAsync(url, args) { return new Promise((resolve, reject) => { - client.get(url, args, (data, response) => { + restClient.get(url, args, (data, response) => { if (response.statusCode >= 400) { reject(data); } From 7bf72beed71ec5a4305ba6636b12447e89bf0f9e Mon Sep 17 00:00:00 2001 From: RealBeepMcJeep Date: Tue, 29 Aug 2023 14:29:02 -0700 Subject: [PATCH 11/68] move AIHorde import to top --- server.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server.js b/server.js index 559ec3927..bbaa45fa3 100644 --- a/server.js +++ b/server.js @@ -49,6 +49,7 @@ const yauzl = require('yauzl'); const tiktoken = require('@dqbd/tiktoken'); // local library imports +const AIHorde = require("./src/horde"); const basicAuthMiddleware = require('./src/middleware/basicAuthMiddleware'); const characterCardParser = require('./src/character-card-parser.js'); const contentManager = require('./src/content-manager'); @@ -135,7 +136,6 @@ const listen = config.listen; const allowKeysExposure = config.allowKeysExposure; function getHordeClient() { - const AIHorde = require("./src/horde"); const ai_horde = new AIHorde({ client_agent: getVersion()?.agent || 'SillyTavern:UNKNOWN:Cohee#1207', }); From 403546e514c3527b1f1b23abb7ae7cc63a093954 Mon Sep 17 00:00:00 2001 From: RealBeepMcJeep Date: Tue, 29 Aug 2023 14:34:41 -0700 Subject: [PATCH 12/68] finish moving and organizing require statements --- server.js | 45 +++++++++++++++------------------------------ 1 file changed, 15 insertions(+), 30 deletions(-) diff --git a/server.js b/server.js index bbaa45fa3..86a170770 100644 --- a/server.js +++ b/server.js @@ -8,6 +8,9 @@ const http = require("http"); const https = require('https'); const path = require('path'); const readline = require('readline'); +const util = require('util'); +const { Readable } = require('stream'); +const { finished } = require('stream/promises'); const { TextEncoder, TextDecoder } = require('util'); // cli/fs related library imports @@ -19,7 +22,9 @@ const writeFileAtomicSync = require('write-file-atomic').sync; const yargs = require('yargs/yargs'); const { hideBin } = require('yargs/helpers'); -// express related library imports +// express/server related library imports +const cors = require('cors'); +const doubleCsrf = require('csrf-csrf').doubleCsrf; const express = require('express'); const compression = require('compression'); const cookieParser = require('cookie-parser'); @@ -29,6 +34,7 @@ const responseTime = require('response-time'); // net related library imports const axios = require('axios'); const DeviceDetector = require("device-detector-js"); +const fetch = require('node-fetch').default; const ipaddr = require('ipaddr.js'); const ipMatching = require('ip-matching'); const json5 = require('json5'); @@ -46,13 +52,20 @@ const webp = require('webp-converter'); const yauzl = require('yauzl'); // tokenizing related library imports +const { SentencePieceProcessor } = require("@agnai/sentencepiece-js"); const tiktoken = require('@dqbd/tiktoken'); +const { Tokenizer } = require('@agnai/web-tokenizers'); + +// misc/other imports +const _ = require('lodash'); +const { generateRequestUrl, normaliseResponse } = require('google-translate-api-browser'); // local library imports const AIHorde = require("./src/horde"); const basicAuthMiddleware = require('./src/middleware/basicAuthMiddleware'); const characterCardParser = require('./src/character-card-parser.js'); const contentManager = require('./src/content-manager'); +const novelai = require('./src/novelai'); const statsHelpers = require('./statsHelpers.js'); createDefaultFiles(); @@ -189,8 +202,6 @@ function get_mancer_headers() { const delay = ms => new Promise(resolve => setTimeout(resolve, ms)) -const { SentencePieceProcessor } = require("@agnai/sentencepiece-js"); -const { Tokenizer } = require('@agnai/web-tokenizers'); const CHARS_PER_TOKEN = 3.35; let spp_llama; @@ -339,8 +350,6 @@ const directories = { // CSRF Protection // if (cliArguments.disableCsrf === false) { - const doubleCsrf = require('csrf-csrf').doubleCsrf; - const CSRF_SECRET = crypto.randomBytes(8).toString('hex'); const COOKIES_SECRET = crypto.randomBytes(8).toString('hex'); @@ -374,7 +383,6 @@ if (cliArguments.disableCsrf === false) { } // CORS Settings // -const cors = require('cors'); const CORS = cors({ origin: 'null', methods: ['OPTIONS'] @@ -545,7 +553,6 @@ app.post("/generate", jsonParser, async function (request, response_generate = r let fetch, url, response; for (let i = 0; i < MAX_RETRIES; i++) { try { - fetch = require('node-fetch').default; url = request.body.streaming ? `${api_server}/extra/generate/stream` : `${api_server}/v1/generate`; response = await fetch(url, { method: 'POST', timeout: 0, ...args }); @@ -893,13 +900,11 @@ function convertToV2(char) { function unsetFavFlag(char) { - const _ = require('lodash'); _.set(char, 'fav', false); _.set(char, 'data.extensions.fav', false); } function readFromV2(char) { - const _ = require('lodash'); if (_.isUndefined(char.data)) { console.warn('Spec v2 data missing'); return char; @@ -954,7 +959,6 @@ function readFromV2(char) { //***************** Main functions function charaFormatData(data) { // This is supposed to save all the foreign keys that ST doesn't care about - const _ = require('lodash'); const char = tryParse(data.json_data) || {}; // This function uses _.cond() to create a series of conditional checks that return the desired output based on the input data. @@ -1093,7 +1097,6 @@ app.post("/renamecharacter", jsonParser, async function (request, response) { const newChatsPath = path.join(chatsPath, newInternalName); try { - const _ = require('lodash'); // Read old file, replace name int it const rawOldData = await charaRead(oldAvatarPath); const oldData = getCharaCardV2(json5.parse(rawOldData)); @@ -1895,7 +1898,6 @@ app.post("/generate_novelai", jsonParser, async function (request, response_gene controller.abort(); }); - const novelai = require('./src/novelai'); const isNewModel = (request.body.model.includes('clio') || request.body.model.includes('kayra')); const badWordsList = novelai.getBadWordsList(request.body.model); @@ -1950,7 +1952,7 @@ app.post("/generate_novelai", jsonParser, async function (request, response_gene "order": request.body.order } }; - const util = require('util'); + console.log(util.inspect(data, { depth: 4 })) const args = { @@ -1960,7 +1962,6 @@ app.post("/generate_novelai", jsonParser, async function (request, response_gene }; try { - const fetch = require('node-fetch').default; const url = request.body.streaming ? `${api_novelai}/ai/generate-stream` : `${api_novelai}/ai/generate`; const response = await fetch(url, { method: 'POST', timeout: 0, ...args }); @@ -2311,7 +2312,6 @@ app.post("/exportchat", jsonParser, async function (request, response) { } } - const readline = require('readline'); const readStream = fs.createReadStream(filename); const rl = readline.createInterface({ input: readStream, @@ -3275,7 +3275,6 @@ function convertClaudePrompt(messages, addHumanPrefix, addAssistantPostfix) { } async function sendScaleRequest(request, response) { - const fetch = require('node-fetch').default; const api_url = new URL(request.body.api_url_scale).toString(); const api_key_scale = readSecret(SECRET_KEYS.SCALE); @@ -3389,7 +3388,6 @@ app.post("/generate_altscale", jsonParser, function (request, response_generate_ }); async function sendClaudeRequest(request, response) { - const fetch = require('node-fetch').default; const api_url = new URL(request.body.reverse_proxy || api_claude).toString(); const api_key_claude = request.body.reverse_proxy ? request.body.proxy_password : readSecret(SECRET_KEYS.CLAUDE); @@ -3965,7 +3963,6 @@ app.post("/tokenize_via_api", jsonParser, async function (request, response) { // ** REST CLIENT ASYNC WRAPPERS ** async function postAsync(url, args) { - const fetch = require('node-fetch').default; const response = await fetch(url, { method: 'POST', timeout: 0, ...args }); if (response.ok) { @@ -4444,8 +4441,6 @@ app.post('/libre_translate', jsonParser, async (request, response) => { }); app.post('/google_translate', jsonParser, async (request, response) => { - const { generateRequestUrl, normaliseResponse } = require('google-translate-api-browser'); - const text = request.body.text; const lang = request.body.lang; @@ -4491,7 +4486,6 @@ app.post('/deepl_translate', jsonParser, async (request, response) => { console.log('Input text: ' + text); - const fetch = require('node-fetch').default; const params = new URLSearchParams(); params.append('text', text); params.append('target_lang', lang); @@ -4537,7 +4531,6 @@ app.post('/novel_tts', jsonParser, async (request, response) => { } try { - const fetch = require('node-fetch').default; const url = `${api_novelai}/ai/generate-voice?text=${encodeURIComponent(text)}&voice=-1&seed=${encodeURIComponent(voice)}&opus=false&version=v2`; const result = await fetch(url, { method: 'GET', @@ -4721,8 +4714,6 @@ app.post('/import_custom', jsonParser, async (request, response) => { }); async function downloadChubLorebook(id) { - const fetch = require('node-fetch').default; - const result = await fetch('https://api.chub.ai/api/lorebooks/download', { method: 'POST', headers: { 'Content-Type': 'application/json' }, @@ -4746,8 +4737,6 @@ async function downloadChubLorebook(id) { } async function downloadChubCharacter(id) { - const fetch = require('node-fetch').default; - const result = await fetch('https://api.chub.ai/api/characters/download', { method: 'POST', headers: { 'Content-Type': 'application/json' }, @@ -5241,8 +5230,6 @@ function checkAssetFileName(inputFilename) { * @returns {void} */ app.post('/asset_download', jsonParser, async (request, response) => { - const { Readable } = require('stream'); - const { finished } = require('stream/promises'); const url = request.body.url; const inputCategory = request.body.category; const inputFilename = sanitize(request.body.filename); @@ -5308,8 +5295,6 @@ app.post('/asset_download', jsonParser, async (request, response) => { * @returns {void} */ app.post('/asset_delete', jsonParser, async (request, response) => { - const { Readable } = require('stream'); - const { finished } = require('stream/promises'); const inputCategory = request.body.category; const inputFilename = sanitize(request.body.filename); const validCategories = ["bgm", "ambient"]; From 1ce7131c1b20cc8dd99434b44a98a51eeffcb733 Mon Sep 17 00:00:00 2001 From: RealBeepMcJeep Date: Tue, 29 Aug 2023 14:39:15 -0700 Subject: [PATCH 13/68] remove jsconfig to match current staging --- jsconfig.json | 16 ---------------- 1 file changed, 16 deletions(-) delete mode 100644 jsconfig.json diff --git a/jsconfig.json b/jsconfig.json deleted file mode 100644 index 790faa9d6..000000000 --- a/jsconfig.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "compilerOptions": { - "module": "ESNext", - "target": "ESNext", - "moduleResolution": "node", - "strictNullChecks": true, - "strictFunctionTypes": true, - "checkJs": true, - "allowUmdGlobalAccess": true, - "allowSyntheticDefaultImports": true - }, - "exclude": [ - "node_modules", - "**/node_modules/*" - ] -} \ No newline at end of file From 7eebbca3dd5955c25eb2c98edadce01110d7c517 Mon Sep 17 00:00:00 2001 From: Cohee <18619528+Cohee1207@users.noreply.github.com> Date: Wed, 30 Aug 2023 02:09:30 +0300 Subject: [PATCH 14/68] Fixed extension prompt insertion at depth 1 --- public/script.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/script.js b/public/script.js index 476087009..c39fc9621 100644 --- a/public/script.js +++ b/public/script.js @@ -2801,11 +2801,11 @@ async function Generate(type, { automatic_trigger, force_name2, resolve, reject, return; } - const anchorDepth = Math.abs(index - finalMesSend.length + 1); + const anchorDepth = Math.abs(index - finalMesSend.length); // NOTE: Depth injected here! const extensionAnchor = getExtensionPrompt(extension_prompt_types.IN_CHAT, anchorDepth); - if (anchorDepth > 0 && extensionAnchor && extensionAnchor.length) { + if (anchorDepth >= 0 && extensionAnchor && extensionAnchor.length) { mesItem.extensionPrompts.push(extensionAnchor); } }); From 31ab7a86dedc77c35cbdbaca65e643cdb0807739 Mon Sep 17 00:00:00 2001 From: Memerlin Date: Tue, 29 Aug 2023 19:22:25 -0600 Subject: [PATCH 15/68] Started Spanish translation for ST Just as a note, I copied and pasted the japanese strings to translate them to spanish. --- public/i18n.json | 567 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 563 insertions(+), 4 deletions(-) diff --git a/public/i18n.json b/public/i18n.json index 6abab8c31..2e41cda5e 100644 --- a/public/i18n.json +++ b/public/i18n.json @@ -4,8 +4,9 @@ "ja-jp", "ko-kr", "ru-ru", - "it-it", - "nl-nl" + "it-it", + "nl-nl", + "es-spa" ], "zh-cn": { "clickslidertips": "点击滑块右侧数字可手动输入", @@ -3483,5 +3484,563 @@ "Select this as default persona for the new chats.": "Selecteer dit als standaard persona voor de nieuwe chats.", "Change persona image": "persona afbeelding wijzigen", "Delete persona": "persona verwijderen" - } -} + }, + "es-spa": { + "clickslidertips": "Haz click en el número al lado de la barra para seleccionar un número manualmente.", + "kobldpresets": "Configuraciones de KoboldAI", + "guikoboldaisettings": "Configuración actual de la interfaz de KoboldAI", + "novelaipreserts": "Configuraciones de NovelAI", + "default": "Predeterminado", + "openaipresets": "Configuraciones de OpenAI", + "text gen webio(ooba) presets": "Configuraciones de WebUI(ooba)", + "response legth(tokens)": "Largo de la respuesta de la IA (en Tokens)", + "select": "Seleccionar", + "context size(tokens)": "Tamaño del contexto (en Tokens)", + "unlocked": "Desbloqueado", + "only select modls support context sizes greater than 2048 tokens. proceed only is you know you're doing": "Solo algunos modelos tienen soporte para tamaños de más de 2048 tokens. Procede solo si sabes lo que estás haciendo.", + "rep.pen": "Rep. Pen.", + "rep.pen range": "Rango de Rep. Pen.", + "temperature": "Temperature", + "Encoder Rep. Pen.": "Encoder Rep. Pen.", + "No Repeat Ngram Size": "No Repeat Ngram Size", + "Min Length": "Largo mínimo", + "OpenAI Reverse Proxy": "Reverse Proxy de OpenAI", + "Alternative server URL (leave empty to use the default value).": "URL del server alternativo (deja vacío para usar el predeterminado)", + "Remove your real OAI API Key from the API panel BEFORE typing anything into this box": "Borra tu clave(API) real de OpenAI ANTES de escribir nada en este campo.", + "We cannot provide support for problems encountered while using an unofficial OpenAI proxy": "SillyTaven no puede dar soporte por problemas encontrados durante el uso de un proxy no-oficial de OpenAI", + "Legacy Streaming Processing": "Processo Streaming Legacy", + "Enable this if the streaming doesn't work with your proxy": "Habilita esta opción si el \"streaming\" no está funcionando.", + "Context Size (tokens)": "Tamaño del contexto (en Tokens)", + "Max Response Length (tokens)": "Tamaño máximo (en Tokens)", + "Temperature": "Temperatura", + "Frequency Penalty": "Frequency Penalty", + "Presence Penalty": "Presence Penalty", + "Top-p": "Top-p", + "Display bot response text chunks as they are generated": "Muestra el texto poco a poco al mismo tiempo que es generado.", + "Top A": "Top-a", + "Typical Sampling": "Typical Sampling", + "Tail Free Sampling": "Tail Free Sampling", + "Rep. Pen. Slope": "Rep. Pen. Slope", + "Single-line mode": "Modo \"Solo una línea\"", + "Top K": "Top-k", + "Top P": "Top-p", + "Do Sample": "Do Sample", + "Add BOS Token": "Añadir BOS Token", + "Add the bos_token to the beginning of prompts. Disabling this can make the replies more creative.": "Añade el \"bos_token\" al inicio del prompt. Desabilitar esto puede hacer las respuestas de la IA más creativas", + "Ban EOS Token": "Prohibir EOS Token", + "Ban the eos_token. This forces the model to never end the generation prematurely": "Prohibe el \"eos_token\". Esto obliga a la IA a no terminar su generación de forma prematura", + "Skip Special Tokens": "Saltarse Tokens Especiales", + "Beam search": "Beam Search", + "Number of Beams": "Number of Beams", + "Length Penalty": "Length Penalty", + "Early Stopping": "Early Stopping", + "Contrastive search": "Contrastive search", + "Penalty Alpha": "Penalty Alpha", + "Seed": "Seed", + "Inserts jailbreak as a last system message.": "Inserta el \"jailbreak\" como el último mensaje del Sistema", + "This tells the AI to ignore its usual content restrictions.": "Esto ayuda a la IA para ignorar sus restricciones de contenido", + "NSFW Encouraged": "Alentar \"NSFW\"", + "Tell the AI that NSFW is allowed.": "Le dice a la IA que el contenido NSFW (+18) está permitido", + "NSFW Prioritized": "Priorizar NSFW", + "NSFW prompt text goes first in the prompt to emphasize its effect.": "El \"prompt NSFW\" va antes para enfatizar su efecto", + "Streaming": "Streaming", + "Display the response bit by bit as it is generated.": "Enseña el texto poco a poco mientras es generado", + "When this is off, responses will be displayed all at once when they are complete.": "Cuando esto está deshabilitado, las respuestas se mostrarán de una vez cuando la generación se haya completado", + "Enhance Definitions": "Definiciones Mejoradas", + "Use OAI knowledge base to enhance definitions for public figures and known fictional characters": "Usa el conocimiento de OpenAI (GPT 3.5, GPT 4, ChatGPT) para mejorar las definiciones de figuras públicas y personajes ficticios", + "Wrap in Quotes": "Envolver En Comillas", + "Wrap entire user message in quotes before sending.": "Envuelve todo el mensaje en comillas antes de enviar", + "Leave off if you use quotes manually for speech.": "Déjalo deshabilitado si usas comillas manualmente para denotar diálogo", + "Main prompt": "Prompt Principal", + "The main prompt used to set the model behavior": "El prompt principal usado para definir el comportamiento de la IA", + "NSFW prompt": "Prompt NSFW", + "Prompt that is used when the NSFW toggle is on": "Prompt que es utilizado cuando \"Alentar NSFW\" está activado", + "Jailbreak prompt": "Jailbreak prompt", + "Prompt that is used when the Jailbreak toggle is on": "Prompt que es utilizado cuando Jailbreak Prompt está activado", + "Impersonation prompt": "Prompt \"Impersonar\"", + "Prompt that is used for Impersonation function": "Prompt que es utilizado para la función \"Impersonar\"", + "Logit Bias": "Logit Bias", + "Helps to ban or reenforce the usage of certain words": "Ayuda a prohibir o alentar el uso de algunas palabras", + "View / Edit bias preset": "Ver/Editar configuración de \"Logit Bias\"", + "Add bias entry": "Añadir bias", + "Jailbreak activation message": "Mensaje de activación de Jailbrak", + "Message to send when auto-jailbreak is on.": "Mensaje enviado cuando auto-jailbreak está activado", + "Jailbreak confirmation reply": "Mensaje de confirmación de Jailbreak", + "Bot must send this back to confirm jailbreak": "La IA debe enviar un mensaje para confirmar el jailbreak", + "Character Note": "Nota del personaje", + "Influences bot behavior in its responses": "Influencia el comportamiento de la IA y sus respuestas", + "API": "API", + "KoboldAI": "KoboldAI", + "Use Horde": "Usar AI Horde de KoboldAI", + "API url": "URL de la API", + "Register a Horde account for faster queue times": "Regístrate en KoboldAI para conseguir respuestas más rápido", + "Learn how to contribute your idle GPU cycles to the Hord": "Aprende cómo contribuir a AI Horde con tu GPU", + "Adjust context size to worker capabilities": "Ajustar tamaño del contexto a las capacidades del trabajador", + "Adjust response length to worker capabilities": "Ajustar tamaño de la respuesta a las capacidades del trabajador", + "API key": "API key", + "Register": "Registrarse", + "For privacy reasons": "プライバシーのため、API キーはページをリロードするまで非表示になります", + "Model": "モデル", + "Hold Control / Command key to select multiple models.": "複数のモデルを選択するには、Control / Command キーを押してください。", + "Horde models not loaded": "Horde モデルがロードされていない", + "Not connected": "接続されていません", + "Novel API key": "NovelAI API キー", + "Follow": "以下の", + "these directions": "指示", + "to get your NovelAI API key.": "あなたの NovelAI API キーを取得するために。", + "Enter it in the box below": "以下のボックスに入力してください", + "Novel AI Model": "NovelAI モデル", + "Euterpe": "Euterpe", + "Krake": "Krake", + "No connection": "接続なし", + "oobabooga/text-generation-webui": "", + "Make sure you run it with": "必ず --api の引数を含めて起動してください", + "Blocking API url": "ブロッキング API URL", + "Streaming API url": "ストリーミング API URL", + "to get your OpenAI API key.": "あなたの OpenAI API キーを取得するために。", + "OpenAI Model": "OpenAI モデル", + "View API Usage Metrics": "API 使用メトリックスの表示", + "Bot": "ボット", + "Connect to the API": "API に接続", + "Auto-connect to Last Server": "前回のサーバーに自動接続", + "View hidden API keys": "非表示 API キーを表示", + "Advanced Formatting": "高度なフォーマット", + "AutoFormat Overrides": "自動フォーマットのオーバーライド", + "Disable description formatting": "説明フォーマットを無効にする", + "Disable personality formatting": "パーソナリティフォーマットを無効にする", + "Disable scenario formatting": "シナリオフォーマットを無効にする", + "Disable example chats formatting": "チャットの例のフォーマットを無効にする", + "Disable chat start formatting": "チャット開始フォーマットを無効にする", + "Custom Chat Separator": "カスタムチャットセパレーター", + "Instruct Mode": "インストラクトモード", + "Enabled": "有効", + "Wrap Sequences with Newline": "シーケンスを改行でラップする", + "Include Names": "名前を含める", + "System Prompt": "システムプロンプト", + "Instruct Mode Sequences": "命令モードシーケンス", + "Input Sequence": "入力シーケンス", + "First Output Sequence": "最初の出力シーケンス", + "Last Output Sequence": "最後の出力シーケンス", + "System Sequence Prefix": "システムシーケンスプレフィックス", + "System Sequence Suffix": "システムシーケンスサフィックス", + "Stop Sequence": "停止シーケンス", + "Context Formatting": "コンテキストフォーマッティング", + "Tokenizer": "トークナイザー", + "None / Estimated": "なし/推定", + "Sentencepiece (LLaMA)": "Sentencepiece(LLaMA)", + "Token Padding": "トークンパディング", + "Always add character's name to prompt": "常にキャラクター名をプロンプトに追加", + "Keep Example Messages in Prompt": "プロンプトに例示メッセージを保持", + "Remove Empty New Lines from Output": "出力から空の改行を削除", + "Pygmalion Formatting": "ピグマリオンフォーマット", + "Disabled for all models": "すべてのモデルで無効", + "Automatic (based on model name)": "自動(モデル名に基づく)", + "Enabled for all models": "すべてのモデルで有効", + "Multigen": "マルチジェン", + "First chunk (tokens)": "最初のチャンク(トークン)", + "Next chunks (tokens)": "次のチャンク(トークン)", + "Anchors Order": "アンカーオーダー", + "Character then Style": "キャラクター、次にスタイル", + "Style then Character": "スタイル、次にキャラクター", + "Character Anchor": "キャラクターアンカー", + "Style Anchor": "スタイルアンカー", + "World Info": "", + "Scan Depth": "スキャン深度", + "depth": "深さ", + "Token Budget": "トークン予算", + "budget": "予算", + "Recursive scanning": "再帰的スキャン", + "Soft Prompt": "ソフトプロンプト", + "About soft prompts": "ソフトプロンプトについて", + "None": "なし", + "User Settings": "ユーザー設定", + "UI Customization": "UIカスタマイズ", + "Avatar Style": "アバタースタイル", + "Circle": "丸", + "Rectangle": "四角形", + "Chat Style": "チャットスタイル:", + "Default": "デフォルト", + "Bubbles": "吹き出し", + "Chat Width (PC)": "チャット幅(PC):", + "No Blur Effect": "ボケ効果なし", + "No Text Shadows": "テキストシャドウなし", + "Waifu Mode": "♡ Waifuモード♡", + "Message Timer": "メッセージタイマー", + "Characters Hotswap": "キャラクターのホットスワップ", + "Movable UI Panels": "移動可能なUIパネル", + "Reset Panels": "パネルをリセットする", + "UI Colors": "UIの色", + "Main Text": "本文", + "Italics Text": "斜体テキスト", + "Quote Text": "引用テキスト", + "Shadow Color": "シャドウカラー", + "FastUI BG": "FastUI BG", + "Blur Tint": "ぼかし色合い", + "Font Scale": "フォントスケール", + "Blur Strength": "ぼかしの強度", + "Text Shadow Width": "テキストシャドウの幅", + "UI Theme Preset": "UIテーマプリセット", + "Power User Options": "パワーユーザーオプション", + "Swipes": "スワイプ", + "Background Sound Only": "背景音のみ", + "Auto-load Last Chat": "最後のチャットを自動読み込み", + "Auto-save Message Edits": "メッセージの編集を自動保存", + "Auto-fix Markdown": "Markdownを自動修正", + "Allow : in bot messages": "ボットメッセージで「:」を許可する", + "Auto-scroll Chat": "チャット自動スクロール", + "Render Formulas": "数式のレンダリング", + "Send on Enter": "エンター入力で送信", + "Always disabled": "常に無効", + "Automatic (desktop)": "自動(デスクトップ)", + "Always enabled": "常に有効", + "Name": "名前", + "Your Avatar": "あなたのアバター", + "Extensions API:": "拡張機能API:", + "SillyTavern-extras": "SillyTavern-extras", + "Auto-connect": "自動接続", + "Active extensions": "アクティブな拡張機能", + "Extension settings": "拡張機能の設定", + "Description": "説明", + "First message": "最初のメッセージ", + "Group Controls": "グループのコントロール", + "Group reply strategy": "グループの返信戦略", + "Natural order": "自然な順序", + "List order": "リストの順序", + "Allow self responses": "自己応答を許可する", + "Auto Mode": "自動モード", + "Add Members": "メンバーを追加", + "Current Members": "現在のメンバー", + "text": "テキスト", + "Delete": "削除", + "Cancel": "キャンセル", + "Advanced Defininitions": "高度な定義", + "Personality summary": "性格の概要", + "A brief description of the personality": "性格の簡単な説明", + "Scenario": "シナリオ", + "Circumstances and context of the dialogue": "対話の状況と文脈", + "Talkativeness": "おしゃべり度", + "How often the chracter speaks in": "グループチャットでの話し方", + "group chats!": "", + "Shy": "内気", + "Normal": "普通", + "Chatty": "おしゃべりさん", + "Examples of dialogue": "対話の例", + "Forms a personality more clearly": "個性をより明確に形成する", + "Save": "保存", + "World Info Editor": "情報エディタ", + "New Entry": "新規エントリ", + "Export": "エクスポート", + "Delete World": "ワールドの削除", + "Chat History": "チャット履歴", + "Group Chat Scenario Override": "グループチャットシナリオのオーバーライド", + "All group members will use the following scenario text instead of what is specified in their character cards.": "すべてのグループメンバーは、キャラクターカードで指定されたものではなく、以下のシナリオテキストを使用します。", + "Keywords": "キーワード", + "Separate with commas": "コンマで区切る", + "Secondary Required Keywords": "必須の秒要キーワード", + "Content": "内容", + "What this keyword should mean to the AI": "このキーワードがAIにとってどういう意味を持つべきか", + "Memo/Note": "メモ/ノート", + "Not sent to AI": "AIに送信されない", + "Constant": "定数", + "Selective": "選択", + "Before Char": "文字の前に", + "After Char": "文字の後に", + "Insertion Order": "挿入順", + "Tokens:": "トークン", + "Disable": "無効にする", + "${characterName}": "${キャラクター名}", + "CHAR": "文字", + "is typing": "入力中...", + "Back to parent chat": "親チャットに戻る", + "Save bookmark": "ブックマークに保存", + "Convert to group": "グループに変換", + "Start new chat": "新しいチャットを開始", + "View past chats": "過去のチャットを表示", + "Delete messages": "メッセージを削除", + "Impersonate": "なりすます", + "Regenerate": "再生成", + "PNG": "PNG", + "JSON": "JSON", + "WEBP": "WEBP", + "presets": "プリセット", + "Message Sound": "メッセージ音", + "Author's Note": "作者の注記", + "Send Jailbreak": "NEEDS TRANSLATION", + "Replace empty message": "NEEDS TRANSLATION", + "Send this text instead of nothing when the text box is empty.": "NEEDS TRANSLATION", + "NSFW avoidance prompt": "NEEDS TRANSLATION", + "Prompt that is used when the NSFW toggle is off": "NEEDS TRANSLATION", + "Advanced prompt bits": "NEEDS TRANSLATION", + "World Info format template": "NEEDS TRANSLATION", + "Wraps activated World Info entries before inserting into the prompt. Use {0} to mark a place where the content is inserted.": "NEEDS TRANSLATION", + "Unrestricted maximum value for the context slider": "NEEDS TRANSLATION", + "Chat Completion Source": "NEEDS TRANSLATION", + "Avoid sending sensitive information to the Horde.": "NEEDS TRANSLATION", + "Review the Privacy statement": "NEEDS TRANSLATION", + "Learn how to contribute your idel GPU cycles to the Horde": "NEEDS TRANSLATION", + "Trusted workers only": "NEEDS TRANSLATION", + "For privacy reasons, your API key will be hidden after you reload the page.": "NEEDS TRANSLATION", + "-- Horde models not loaded --": "NEEDS TRANSLATION", + "Example: http://127.0.0.1:5000/api ": "NEEDS TRANSLATION", + "No connection...": "NEEDS TRANSLATION", + "Get your NovelAI API Key": "NEEDS TRANSLATION", + "KoboldAI Horde": "NEEDS TRANSLATION", + "Text Gen WebUI (ooba)": "NEEDS TRANSLATION", + "NovelAI": "NEEDS TRANSLATION", + "Chat Completion (OpenAI, Claude, Window/OpenRouter, Scale)": "NEEDS TRANSLATION", + "OpenAI API key": "NEEDS TRANSLATION", + "Trim spaces": "NEEDS TRANSLATION", + "Trim Incomplete Sentences": "NEEDS TRANSLATION", + "Include Newline": "NEEDS TRANSLATION", + "Non-markdown strings": "NEEDS TRANSLATION", + "Replace Macro in Sequences": "NEEDS TRANSLATION", + "Presets": "NEEDS TRANSLATION", + "Separator": "NEEDS TRANSLATION", + "Start Reply With": "NEEDS TRANSLATION", + "Show reply prefix in chat": "NEEDS TRANSLATION", + "Worlds/Lorebooks": "NEEDS TRANSLATION", + "Active World(s)": "NEEDS TRANSLATION", + "Character Lore Insertion Strategy": "NEEDS TRANSLATION", + "Sorted Evenly": "NEEDS TRANSLATION", + "Character Lore First": "NEEDS TRANSLATION", + "Global Lore First": "NEEDS TRANSLATION", + "-- World Info not found --": "NEEDS TRANSLATION", + "Recursive Scan": "NEEDS TRANSLATION", + "Case Sensitive": "NEEDS TRANSLATION", + "Match whole words": "NEEDS TRANSLATION", + "World/Lore Editor": "NEEDS TRANSLATION", + "--- None ---": "NEEDS TRANSLATION", + "Comma seperated (ignored if empty)": "NEEDS TRANSLATION", + "Use Probability": "NEEDS TRANSLATION", + "Exclude from recursion": "NEEDS TRANSLATION", + "Position:": "NEEDS TRANSLATION", + "Before Char Defs": "NEEDS TRANSLATION", + "After Char Defs": "NEEDS TRANSLATION", + "Before AN": "NEEDS TRANSLATION", + "After AN": "NEEDS TRANSLATION", + "Order:": "NEEDS TRANSLATION", + "Probability:": "NEEDS TRANSLATION", + "Delete Entry": "NEEDS TRANSLATION", + "User Message Blur Tint": "NEEDS TRANSLATION", + "AI Message Blur Tint": "NEEDS TRANSLATION", + "Chat Style:": "NEEDS TRANSLATION", + "Chat Width (PC):": "NEEDS TRANSLATION", + "Chat Timestamps": "NEEDS TRANSLATION", + "Message IDs": "NEEDS TRANSLATION", + "Prefer Character Card Prompt": "NEEDS TRANSLATION", + "Prefer Character Card Jailbreak": "NEEDS TRANSLATION", + "Press Send to continue": "NEEDS TRANSLATION", + "Log prompts to console": "NEEDS TRANSLATION", + "Never resize avatars": "NEEDS TRANSLATION", + "Show avatar filenames": "NEEDS TRANSLATION", + "Import Card Tags": "NEEDS TRANSLATION", + "Confirm message deletion": "NEEDS TRANSLATION", + "Spoiler Free Mode": "NEEDS TRANSLATION", + "Auto-swipe": "NEEDS TRANSLATION", + "Minimum generated message length": "NEEDS TRANSLATION", + "Blacklisted words": "NEEDS TRANSLATION", + "Blacklisted word count to swipe": "NEEDS TRANSLATION", + "Reload Chat": "NEEDS TRANSLATION", + "Not Connected": "NEEDS TRANSLATION", + "Persona Management": "NEEDS TRANSLATION", + "Persona Description": "NEEDS TRANSLATION", + "In Story String / Chat Completion: Before Character Card": "NEEDS TRANSLATION", + "In Story String / Chat Completion: After Character Card": "NEEDS TRANSLATION", + "Top of Author's Note": "NEEDS TRANSLATION", + "Bottom of Author's Note": "NEEDS TRANSLATION", + "How do I use this?": "NEEDS TRANSLATION", + "More...": "NEEDS TRANSLATION", + "Link to World Info": "NEEDS TRANSLATION", + "Import Card Lore": "NEEDS TRANSLATION", + "Scenario Override": "NEEDS TRANSLATION", + "Rename": "NEEDS TRANSLATION", + "Character Description": "NEEDS TRANSLATION", + "Creator's Notes": "NEEDS TRANSLATION", + "A-Z": "NEEDS TRANSLATION", + "Z-A": "NEEDS TRANSLATION", + "Newest": "NEEDS TRANSLATION", + "Oldest": "NEEDS TRANSLATION", + "Favorites": "NEEDS TRANSLATION", + "Recent": "NEEDS TRANSLATION", + "Most chats": "NEEDS TRANSLATION", + "Least chats": "NEEDS TRANSLATION", + "Back": "NEEDS TRANSLATION", + "Prompt Overrides (For OpenAI/Claude/Scale APIs, Window/OpenRouter, and Instruct mode)": "NEEDS TRANSLATION", + "Insert {{original}} into either box to include the respective default prompt from system settings.": "NEEDS TRANSLATION", + "Main Prompt": "NEEDS TRANSLATION", + "Jailbreak": "NEEDS TRANSLATION", + "Creator's Metadata (Not sent with the AI prompt)": "NEEDS TRANSLATION", + "Everything here is optional": "NEEDS TRANSLATION", + "Created by": "NEEDS TRANSLATION", + "Character Version": "NEEDS TRANSLATION", + "Tags to Embed": "NEEDS TRANSLATION", + "How often the character speaks in group chats!": "NEEDS TRANSLATION", + "Important to set the character's writing style.": "NEEDS TRANSLATION", + "ATTENTION!": "NEEDS TRANSLATION", + "Samplers Order": "NEEDS TRANSLATION", + "Samplers will be applied in a top-down order. Use with caution.": "NEEDS TRANSLATION", + "Repetition Penalty": "NEEDS TRANSLATION", + "Epsilon Cutoff": "NEEDS TRANSLATION", + "Eta Cutoff": "NEEDS TRANSLATION", + "Rep. Pen. Range.": "NEEDS TRANSLATION", + "Rep. Pen. Freq.": "NEEDS TRANSLATION", + "Rep. Pen. Presence": "NEEDS TRANSLATION", + "Enter it in the box below:": "NEEDS TRANSLATION", + "separate with commas w/o space between": "NEEDS TRANSLATION", + "Document": "NEEDS TRANSLATION", + "Suggest replies": "NEEDS TRANSLATION", + "Show suggested replies. Not all bots support this.": "NEEDS TRANSLATION", + "Use 'Unlocked Context' to enable chunked generation.": "NEEDS TRANSLATION", + "It extends the context window in exchange for reply generation speed.": "NEEDS TRANSLATION", + "Continue": "NEEDS TRANSLATION", + "Editing:": "NEEDS TRANSLATION", + "AI reply prefix": "NEEDS TRANSLATION", + "Custom Stopping Strings": "NEEDS TRANSLATION", + "JSON serialized array of strings": "NEEDS TRANSLATION", + "words you dont want generated separated by comma ','": "NEEDS TRANSLATION", + "Extensions URL": "NEEDS TRANSLATION", + "API Key": "NEEDS TRANSLATION", + "Enter your name": "NEEDS TRANSLATION", + "Name this character": "NEEDS TRANSLATION", + "Search / Create Tags": "NEEDS TRANSLATION", + "Describe your character's physical and mental traits here.": "NEEDS TRANSLATION", + "This will be the first message from the character that starts every chat.": "NEEDS TRANSLATION", + "Chat Name (Optional)": "NEEDS TRANSLATION", + "Filter...": "NEEDS TRANSLATION", + "Search...": "NEEDS TRANSLATION", + "Any contents here will replace the default Main Prompt used for this character. (v2 spec: system_prompt)": "NEEDS TRANSLATION", + "Any contents here will replace the default Jailbreak Prompt used for this character. (v2 spec: post_history_instructions)": "NEEDS TRANSLATION", + "(Botmaker's name / Contact Info)": "NEEDS TRANSLATION", + "(If you want to track character versions)": "NEEDS TRANSLATION", + "(Describe the bot, give use tips, or list the chat models it has been tested on. This will be displayed in the character list.)": "NEEDS TRANSLATION", + "(Write a comma-separated list of tags)": "NEEDS TRANSLATION", + "(A brief description of the personality)": "NEEDS TRANSLATION", + "(Circumstances and context of the interaction)": "NEEDS TRANSLATION", + "(Examples of chat dialog. Begin each example with START on a new line.)": "NEEDS TRANSLATION", + "Injection text (supports parameters)": "NEEDS TRANSLATION", + "Injection depth": "NEEDS TRANSLATION", + "Type here...": "NEEDS TRANSLATION", + "Comma separated (required)": "NEEDS TRANSLATION", + "Comma separated (ignored if empty)": "NEEDS TRANSLATION", + "What this keyword should mean to the AI, sent verbatim": "NEEDS TRANSLATION", + "Not sent to the AI": "NEEDS TRANSLATION", + "(This will be the first message from the character that starts every chat)": "NEEDS TRANSLATION", + "Not connected to API!": "NEEDS TRANSLATION", + "AI Response Configuration": "NEEDS TRANSLATION", + "AI Configuration panel will stay open": "NEEDS TRANSLATION", + "Update current preset": "NEEDS TRANSLATION", + "Create new preset": "NEEDS TRANSLATION", + "Import preset": "NEEDS TRANSLATION", + "Export preset": "NEEDS TRANSLATION", + "Delete the preset": "NEEDS TRANSLATION", + "NSFW block goes first in the resulting prompt": "NEEDS TRANSLATION", + "Enables OpenAI completion streaming": "NEEDS TRANSLATION", + "Wrap user messages in quotes before sending": "NEEDS TRANSLATION", + "Restore default prompt": "NEEDS TRANSLATION", + "New preset": "NEEDS TRANSLATION", + "Delete preset": "NEEDS TRANSLATION", + "Restore default jailbreak": "NEEDS TRANSLATION", + "Restore default reply": "NEEDS TRANSLATION", + "Restore defaul note": "NEEDS TRANSLATION", + "API Connections": "NEEDS TRANSLATION", + "Can help with bad responses by queueing only the approved workers. May slowdown the response time.": "NEEDS TRANSLATION", + "Clear your API key": "NEEDS TRANSLATION", + "Refresh models": "NEEDS TRANSLATION", + "Get your OpenRouter API token using OAuth flow. You will be redirected to openrouter.ai": "NEEDS TRANSLATION", + "Verifies your API connection by sending a short test message. Be aware that you'll be credited for it!": "NEEDS TRANSLATION", + "Create New": "NEEDS TRANSLATION", + "Edit": "NEEDS TRANSLATION", + "World Info & Soft Prompts": "NEEDS TRANSLATION", + "Locked = World Editor will stay open": "NEEDS TRANSLATION", + "Entries can activate other entries by mentioning their keywords": "NEEDS TRANSLATION", + "Lookup for the entry keys in the context will respect the case": "NEEDS TRANSLATION", + "If the entry key consists of only one word, it would not be matched as part of other words": "NEEDS TRANSLATION", + "Open all Entries": "NEEDS TRANSLATION", + "Close all Entries": "NEEDS TRANSLATION", + "Create": "NEEDS TRANSLATION", + "Import World Info": "NEEDS TRANSLATION", + "Export World Info": "NEEDS TRANSLATION", + "Delete World Info": "NEEDS TRANSLATION", + "Rename World Info": "NEEDS TRANSLATION", + "Save changes to a new theme file": "NEEDS TRANSLATION", + "removes blur and uses alternative background color for divs": "NEEDS TRANSLATION", + "If checked and the character card contains a prompt override (System Prompt), use that instead.": "NEEDS TRANSLATION", + "If checked and the character card contains a jailbreak override (Post History Instruction), use that instead.": "NEEDS TRANSLATION", + "AI Response Formatting": "NEEDS TRANSLATION", + "Change Background Image": "NEEDS TRANSLATION", + "Extensions": "NEEDS TRANSLATION", + "Click to set a new User Name": "NEEDS TRANSLATION", + "Click to lock your selected persona to the current chat. Click again to remove the lock.": "NEEDS TRANSLATION", + "Click to set user name for all messages": "NEEDS TRANSLATION", + "Create a dummy persona": "NEEDS TRANSLATION", + "Character Management": "NEEDS TRANSLATION", + "Locked = Character Management panel will stay open": "NEEDS TRANSLATION", + "Select/Create Characters": "NEEDS TRANSLATION", + "Token counts may be inaccurate and provided just for reference.": "NEEDS TRANSLATION", + "Click to select a new avatar for this character": "NEEDS TRANSLATION", + "Add to Favorites": "NEEDS TRANSLATION", + "Advanced Definition": "NEEDS TRANSLATION", + "Character Lore": "NEEDS TRANSLATION", + "Export and Download": "NEEDS TRANSLATION", + "Duplicate Character": "NEEDS TRANSLATION", + "Create Character": "NEEDS TRANSLATION", + "Delete Character": "NEEDS TRANSLATION", + "View all tags": "NEEDS TRANSLATION", + "Click to set additional greeting messages": "NEEDS TRANSLATION", + "Show / Hide Description and First Message": "NEEDS TRANSLATION", + "Click to select a new avatar for this group": "NEEDS TRANSLATION", + "Set a group chat scenario": "NEEDS TRANSLATION", + "Restore collage avatar": "NEEDS TRANSLATION", + "Create New Character": "NEEDS TRANSLATION", + "Import Character from File": "NEEDS TRANSLATION", + "Import content from external URL": "NEEDS TRANSLATION", + "Create New Chat Group": "NEEDS TRANSLATION", + "Characters sorting order": "NEEDS TRANSLATION", + "Add chat injection": "NEEDS TRANSLATION", + "Remove injection": "NEEDS TRANSLATION", + "Remove": "NEEDS TRANSLATION", + "Select a World Info file for": "NEEDS TRANSLATION", + "Primary Lorebook": "NEEDS TRANSLATION", + "A selected World Info will be bound to this character as its own Lorebook.": "NEEDS TRANSLATION", + "When generating an AI reply, it will be combined with the entries from a global World Info selector.": "NEEDS TRANSLATION", + "Exporting a character would also export the selected Lorebook file embedded in the JSON data.": "NEEDS TRANSLATION", + "Additional Lorebooks": "NEEDS TRANSLATION", + "Associate one or more auxillary Lorebooks with this character.": "NEEDS TRANSLATION", + "NOTE: These choices are optional and won't be preserved on character export!": "NEEDS TRANSLATION", + "Rename chat file": "NEEDS TRANSLATION", + "Export JSONL chat file": "NEEDS TRANSLATION", + "Download chat as plain text document": "NEEDS TRANSLATION", + "Delete chat file": "NEEDS TRANSLATION", + "Delete tag": "NEEDS TRANSLATION", + "Translate message": "NEEDS TRANSLATION", + "Generate Image": "NEEDS TRANSLATION", + "Narrate": "NEEDS TRANSLATION", + "Prompt": "NEEDS TRANSLATION", + "Create Bookmark": "NEEDS TRANSLATION", + "Copy": "NEEDS TRANSLATION", + "Open bookmark chat": "NEEDS TRANSLATION", + "Confirm": "NEEDS TRANSLATION", + "Copy this message": "NEEDS TRANSLATION", + "Delete this message": "NEEDS TRANSLATION", + "Move message up": "NEEDS TRANSLATION", + "Move message down": "NEEDS TRANSLATION", + "Enlarge": "NEEDS TRANSLATION", + "Temporarily disable automatic replies from this character": "NEEDS TRANSLATION", + "Enable automatic replies from this character": "NEEDS TRANSLATION", + "Trigger a message from this character": "NEEDS TRANSLATION", + "Move up": "NEEDS TRANSLATION", + "Move down": "NEEDS TRANSLATION", + "View character card": "NEEDS TRANSLATION", + "Remove from group": "NEEDS TRANSLATION", + "Add to group": "NEEDS TRANSLATION", + "Add": "NEEDS TRANSLATION", + "Abort request": "NEEDS TRANSLATION", + "Send a message": "NEEDS TRANSLATION", + "Ask AI to write your message for you": "NEEDS TRANSLATION", + "Continue the last message": "NEEDS TRANSLATION", + "Bind user name to that avatar": "NEEDS TRANSLATION", + "Select this as default persona for the new chats.": "NEEDS TRANSLATION", + "Change persona image": "NEEDS TRANSLATION", + "Delete persona": "NEEDS TRANSLATION" + } +} \ No newline at end of file From bce346c7b68bb4af27b7fcc942384887c186df10 Mon Sep 17 00:00:00 2001 From: Memerlin Date: Tue, 29 Aug 2023 19:54:03 -0600 Subject: [PATCH 16/68] Spanish translation WIP Deleted japanese translation from the Spanish one. --- public/i18n.json | 496 ++++------------------------------------------- 1 file changed, 34 insertions(+), 462 deletions(-) diff --git a/public/i18n.json b/public/i18n.json index 2e41cda5e..dd6947ebd 100644 --- a/public/i18n.json +++ b/public/i18n.json @@ -3486,7 +3486,7 @@ "Delete persona": "persona verwijderen" }, "es-spa": { - "clickslidertips": "Haz click en el número al lado de la barra para seleccionar un número manualmente.", + "clickslidertips": "Haz click en el número al lado de la barra \npara seleccionar un número manualmente.", "kobldpresets": "Configuraciones de KoboldAI", "guikoboldaisettings": "Configuración actual de la interfaz de KoboldAI", "novelaipreserts": "Configuraciones de NovelAI", @@ -3579,468 +3579,40 @@ "Adjust response length to worker capabilities": "Ajustar tamaño de la respuesta a las capacidades del trabajador", "API key": "API key", "Register": "Registrarse", - "For privacy reasons": "プライバシーのため、API キーはページをリロードするまで非表示になります", - "Model": "モデル", - "Hold Control / Command key to select multiple models.": "複数のモデルを選択するには、Control / Command キーを押してください。", - "Horde models not loaded": "Horde モデルがロードされていない", - "Not connected": "接続されていません", - "Novel API key": "NovelAI API キー", - "Follow": "以下の", - "these directions": "指示", - "to get your NovelAI API key.": "あなたの NovelAI API キーを取得するために。", - "Enter it in the box below": "以下のボックスに入力してください", - "Novel AI Model": "NovelAI モデル", + "For privacy reasons": "Por motivos de privacidad, tu API será ocultada cuando se vuelva a cargar la página", + "Model": "Modelo IA", + "Hold Control / Command key to select multiple models.": "Presiona Ctrl/Command Key para seleccionar multiples modelos", + "Horde models not loaded": "Modelos del Horde no cargados", + "Not connected": "Desconectado", + "Novel API key": "API key de NovelAI", + "Follow": "Sigue", + "these directions": "estas instrucciones", + "to get your NovelAI API key.": "para conseguir tu NovelAI API key", + "Enter it in the box below": "Introduce tu NovelAI API key en el siguiente campo", + "Novel AI Model": "Modelo IA de NovelAI", "Euterpe": "Euterpe", "Krake": "Krake", - "No connection": "接続なし", - "oobabooga/text-generation-webui": "", - "Make sure you run it with": "必ず --api の引数を含めて起動してください", - "Blocking API url": "ブロッキング API URL", - "Streaming API url": "ストリーミング API URL", - "to get your OpenAI API key.": "あなたの OpenAI API キーを取得するために。", - "OpenAI Model": "OpenAI モデル", - "View API Usage Metrics": "API 使用メトリックスの表示", - "Bot": "ボット", - "Connect to the API": "API に接続", - "Auto-connect to Last Server": "前回のサーバーに自動接続", - "View hidden API keys": "非表示 API キーを表示", - "Advanced Formatting": "高度なフォーマット", - "AutoFormat Overrides": "自動フォーマットのオーバーライド", - "Disable description formatting": "説明フォーマットを無効にする", - "Disable personality formatting": "パーソナリティフォーマットを無効にする", - "Disable scenario formatting": "シナリオフォーマットを無効にする", - "Disable example chats formatting": "チャットの例のフォーマットを無効にする", - "Disable chat start formatting": "チャット開始フォーマットを無効にする", - "Custom Chat Separator": "カスタムチャットセパレーター", - "Instruct Mode": "インストラクトモード", - "Enabled": "有効", - "Wrap Sequences with Newline": "シーケンスを改行でラップする", - "Include Names": "名前を含める", - "System Prompt": "システムプロンプト", - "Instruct Mode Sequences": "命令モードシーケンス", - "Input Sequence": "入力シーケンス", - "First Output Sequence": "最初の出力シーケンス", - "Last Output Sequence": "最後の出力シーケンス", - "System Sequence Prefix": "システムシーケンスプレフィックス", - "System Sequence Suffix": "システムシーケンスサフィックス", - "Stop Sequence": "停止シーケンス", - "Context Formatting": "コンテキストフォーマッティング", - "Tokenizer": "トークナイザー", - "None / Estimated": "なし/推定", - "Sentencepiece (LLaMA)": "Sentencepiece(LLaMA)", - "Token Padding": "トークンパディング", - "Always add character's name to prompt": "常にキャラクター名をプロンプトに追加", - "Keep Example Messages in Prompt": "プロンプトに例示メッセージを保持", - "Remove Empty New Lines from Output": "出力から空の改行を削除", - "Pygmalion Formatting": "ピグマリオンフォーマット", - "Disabled for all models": "すべてのモデルで無効", - "Automatic (based on model name)": "自動(モデル名に基づく)", - "Enabled for all models": "すべてのモデルで有効", - "Multigen": "マルチジェン", - "First chunk (tokens)": "最初のチャンク(トークン)", - "Next chunks (tokens)": "次のチャンク(トークン)", - "Anchors Order": "アンカーオーダー", - "Character then Style": "キャラクター、次にスタイル", - "Style then Character": "スタイル、次にキャラクター", - "Character Anchor": "キャラクターアンカー", - "Style Anchor": "スタイルアンカー", - "World Info": "", - "Scan Depth": "スキャン深度", - "depth": "深さ", - "Token Budget": "トークン予算", - "budget": "予算", - "Recursive scanning": "再帰的スキャン", - "Soft Prompt": "ソフトプロンプト", - "About soft prompts": "ソフトプロンプトについて", - "None": "なし", - "User Settings": "ユーザー設定", - "UI Customization": "UIカスタマイズ", - "Avatar Style": "アバタースタイル", - "Circle": "丸", - "Rectangle": "四角形", - "Chat Style": "チャットスタイル:", - "Default": "デフォルト", - "Bubbles": "吹き出し", - "Chat Width (PC)": "チャット幅(PC):", - "No Blur Effect": "ボケ効果なし", - "No Text Shadows": "テキストシャドウなし", - "Waifu Mode": "♡ Waifuモード♡", - "Message Timer": "メッセージタイマー", - "Characters Hotswap": "キャラクターのホットスワップ", - "Movable UI Panels": "移動可能なUIパネル", - "Reset Panels": "パネルをリセットする", - "UI Colors": "UIの色", - "Main Text": "本文", - "Italics Text": "斜体テキスト", - "Quote Text": "引用テキスト", - "Shadow Color": "シャドウカラー", - "FastUI BG": "FastUI BG", - "Blur Tint": "ぼかし色合い", - "Font Scale": "フォントスケール", - "Blur Strength": "ぼかしの強度", - "Text Shadow Width": "テキストシャドウの幅", - "UI Theme Preset": "UIテーマプリセット", - "Power User Options": "パワーユーザーオプション", - "Swipes": "スワイプ", - "Background Sound Only": "背景音のみ", - "Auto-load Last Chat": "最後のチャットを自動読み込み", - "Auto-save Message Edits": "メッセージの編集を自動保存", - "Auto-fix Markdown": "Markdownを自動修正", - "Allow : in bot messages": "ボットメッセージで「:」を許可する", - "Auto-scroll Chat": "チャット自動スクロール", - "Render Formulas": "数式のレンダリング", - "Send on Enter": "エンター入力で送信", - "Always disabled": "常に無効", - "Automatic (desktop)": "自動(デスクトップ)", - "Always enabled": "常に有効", - "Name": "名前", - "Your Avatar": "あなたのアバター", - "Extensions API:": "拡張機能API:", - "SillyTavern-extras": "SillyTavern-extras", - "Auto-connect": "自動接続", - "Active extensions": "アクティブな拡張機能", - "Extension settings": "拡張機能の設定", - "Description": "説明", - "First message": "最初のメッセージ", - "Group Controls": "グループのコントロール", - "Group reply strategy": "グループの返信戦略", - "Natural order": "自然な順序", - "List order": "リストの順序", - "Allow self responses": "自己応答を許可する", - "Auto Mode": "自動モード", - "Add Members": "メンバーを追加", - "Current Members": "現在のメンバー", - "text": "テキスト", - "Delete": "削除", - "Cancel": "キャンセル", - "Advanced Defininitions": "高度な定義", - "Personality summary": "性格の概要", - "A brief description of the personality": "性格の簡単な説明", - "Scenario": "シナリオ", - "Circumstances and context of the dialogue": "対話の状況と文脈", - "Talkativeness": "おしゃべり度", - "How often the chracter speaks in": "グループチャットでの話し方", - "group chats!": "", - "Shy": "内気", - "Normal": "普通", - "Chatty": "おしゃべりさん", - "Examples of dialogue": "対話の例", - "Forms a personality more clearly": "個性をより明確に形成する", - "Save": "保存", - "World Info Editor": "情報エディタ", - "New Entry": "新規エントリ", - "Export": "エクスポート", - "Delete World": "ワールドの削除", - "Chat History": "チャット履歴", - "Group Chat Scenario Override": "グループチャットシナリオのオーバーライド", - "All group members will use the following scenario text instead of what is specified in their character cards.": "すべてのグループメンバーは、キャラクターカードで指定されたものではなく、以下のシナリオテキストを使用します。", - "Keywords": "キーワード", - "Separate with commas": "コンマで区切る", - "Secondary Required Keywords": "必須の秒要キーワード", - "Content": "内容", - "What this keyword should mean to the AI": "このキーワードがAIにとってどういう意味を持つべきか", - "Memo/Note": "メモ/ノート", - "Not sent to AI": "AIに送信されない", - "Constant": "定数", - "Selective": "選択", - "Before Char": "文字の前に", - "After Char": "文字の後に", - "Insertion Order": "挿入順", - "Tokens:": "トークン", - "Disable": "無効にする", - "${characterName}": "${キャラクター名}", - "CHAR": "文字", - "is typing": "入力中...", - "Back to parent chat": "親チャットに戻る", - "Save bookmark": "ブックマークに保存", - "Convert to group": "グループに変換", - "Start new chat": "新しいチャットを開始", - "View past chats": "過去のチャットを表示", - "Delete messages": "メッセージを削除", - "Impersonate": "なりすます", - "Regenerate": "再生成", - "PNG": "PNG", - "JSON": "JSON", - "WEBP": "WEBP", - "presets": "プリセット", - "Message Sound": "メッセージ音", - "Author's Note": "作者の注記", - "Send Jailbreak": "NEEDS TRANSLATION", - "Replace empty message": "NEEDS TRANSLATION", - "Send this text instead of nothing when the text box is empty.": "NEEDS TRANSLATION", - "NSFW avoidance prompt": "NEEDS TRANSLATION", - "Prompt that is used when the NSFW toggle is off": "NEEDS TRANSLATION", - "Advanced prompt bits": "NEEDS TRANSLATION", - "World Info format template": "NEEDS TRANSLATION", - "Wraps activated World Info entries before inserting into the prompt. Use {0} to mark a place where the content is inserted.": "NEEDS TRANSLATION", - "Unrestricted maximum value for the context slider": "NEEDS TRANSLATION", - "Chat Completion Source": "NEEDS TRANSLATION", - "Avoid sending sensitive information to the Horde.": "NEEDS TRANSLATION", - "Review the Privacy statement": "NEEDS TRANSLATION", - "Learn how to contribute your idel GPU cycles to the Horde": "NEEDS TRANSLATION", - "Trusted workers only": "NEEDS TRANSLATION", - "For privacy reasons, your API key will be hidden after you reload the page.": "NEEDS TRANSLATION", - "-- Horde models not loaded --": "NEEDS TRANSLATION", - "Example: http://127.0.0.1:5000/api ": "NEEDS TRANSLATION", - "No connection...": "NEEDS TRANSLATION", - "Get your NovelAI API Key": "NEEDS TRANSLATION", - "KoboldAI Horde": "NEEDS TRANSLATION", - "Text Gen WebUI (ooba)": "NEEDS TRANSLATION", - "NovelAI": "NEEDS TRANSLATION", - "Chat Completion (OpenAI, Claude, Window/OpenRouter, Scale)": "NEEDS TRANSLATION", - "OpenAI API key": "NEEDS TRANSLATION", - "Trim spaces": "NEEDS TRANSLATION", - "Trim Incomplete Sentences": "NEEDS TRANSLATION", - "Include Newline": "NEEDS TRANSLATION", - "Non-markdown strings": "NEEDS TRANSLATION", - "Replace Macro in Sequences": "NEEDS TRANSLATION", - "Presets": "NEEDS TRANSLATION", - "Separator": "NEEDS TRANSLATION", - "Start Reply With": "NEEDS TRANSLATION", - "Show reply prefix in chat": "NEEDS TRANSLATION", - "Worlds/Lorebooks": "NEEDS TRANSLATION", - "Active World(s)": "NEEDS TRANSLATION", - "Character Lore Insertion Strategy": "NEEDS TRANSLATION", - "Sorted Evenly": "NEEDS TRANSLATION", - "Character Lore First": "NEEDS TRANSLATION", - "Global Lore First": "NEEDS TRANSLATION", - "-- World Info not found --": "NEEDS TRANSLATION", - "Recursive Scan": "NEEDS TRANSLATION", - "Case Sensitive": "NEEDS TRANSLATION", - "Match whole words": "NEEDS TRANSLATION", - "World/Lore Editor": "NEEDS TRANSLATION", - "--- None ---": "NEEDS TRANSLATION", - "Comma seperated (ignored if empty)": "NEEDS TRANSLATION", - "Use Probability": "NEEDS TRANSLATION", - "Exclude from recursion": "NEEDS TRANSLATION", - "Position:": "NEEDS TRANSLATION", - "Before Char Defs": "NEEDS TRANSLATION", - "After Char Defs": "NEEDS TRANSLATION", - "Before AN": "NEEDS TRANSLATION", - "After AN": "NEEDS TRANSLATION", - "Order:": "NEEDS TRANSLATION", - "Probability:": "NEEDS TRANSLATION", - "Delete Entry": "NEEDS TRANSLATION", - "User Message Blur Tint": "NEEDS TRANSLATION", - "AI Message Blur Tint": "NEEDS TRANSLATION", - "Chat Style:": "NEEDS TRANSLATION", - "Chat Width (PC):": "NEEDS TRANSLATION", - "Chat Timestamps": "NEEDS TRANSLATION", - "Message IDs": "NEEDS TRANSLATION", - "Prefer Character Card Prompt": "NEEDS TRANSLATION", - "Prefer Character Card Jailbreak": "NEEDS TRANSLATION", - "Press Send to continue": "NEEDS TRANSLATION", - "Log prompts to console": "NEEDS TRANSLATION", - "Never resize avatars": "NEEDS TRANSLATION", - "Show avatar filenames": "NEEDS TRANSLATION", - "Import Card Tags": "NEEDS TRANSLATION", - "Confirm message deletion": "NEEDS TRANSLATION", - "Spoiler Free Mode": "NEEDS TRANSLATION", - "Auto-swipe": "NEEDS TRANSLATION", - "Minimum generated message length": "NEEDS TRANSLATION", - "Blacklisted words": "NEEDS TRANSLATION", - "Blacklisted word count to swipe": "NEEDS TRANSLATION", - "Reload Chat": "NEEDS TRANSLATION", - "Not Connected": "NEEDS TRANSLATION", - "Persona Management": "NEEDS TRANSLATION", - "Persona Description": "NEEDS TRANSLATION", - "In Story String / Chat Completion: Before Character Card": "NEEDS TRANSLATION", - "In Story String / Chat Completion: After Character Card": "NEEDS TRANSLATION", - "Top of Author's Note": "NEEDS TRANSLATION", - "Bottom of Author's Note": "NEEDS TRANSLATION", - "How do I use this?": "NEEDS TRANSLATION", - "More...": "NEEDS TRANSLATION", - "Link to World Info": "NEEDS TRANSLATION", - "Import Card Lore": "NEEDS TRANSLATION", - "Scenario Override": "NEEDS TRANSLATION", - "Rename": "NEEDS TRANSLATION", - "Character Description": "NEEDS TRANSLATION", - "Creator's Notes": "NEEDS TRANSLATION", - "A-Z": "NEEDS TRANSLATION", - "Z-A": "NEEDS TRANSLATION", - "Newest": "NEEDS TRANSLATION", - "Oldest": "NEEDS TRANSLATION", - "Favorites": "NEEDS TRANSLATION", - "Recent": "NEEDS TRANSLATION", - "Most chats": "NEEDS TRANSLATION", - "Least chats": "NEEDS TRANSLATION", - "Back": "NEEDS TRANSLATION", - "Prompt Overrides (For OpenAI/Claude/Scale APIs, Window/OpenRouter, and Instruct mode)": "NEEDS TRANSLATION", - "Insert {{original}} into either box to include the respective default prompt from system settings.": "NEEDS TRANSLATION", - "Main Prompt": "NEEDS TRANSLATION", - "Jailbreak": "NEEDS TRANSLATION", - "Creator's Metadata (Not sent with the AI prompt)": "NEEDS TRANSLATION", - "Everything here is optional": "NEEDS TRANSLATION", - "Created by": "NEEDS TRANSLATION", - "Character Version": "NEEDS TRANSLATION", - "Tags to Embed": "NEEDS TRANSLATION", - "How often the character speaks in group chats!": "NEEDS TRANSLATION", - "Important to set the character's writing style.": "NEEDS TRANSLATION", - "ATTENTION!": "NEEDS TRANSLATION", - "Samplers Order": "NEEDS TRANSLATION", - "Samplers will be applied in a top-down order. Use with caution.": "NEEDS TRANSLATION", - "Repetition Penalty": "NEEDS TRANSLATION", - "Epsilon Cutoff": "NEEDS TRANSLATION", - "Eta Cutoff": "NEEDS TRANSLATION", - "Rep. Pen. Range.": "NEEDS TRANSLATION", - "Rep. Pen. Freq.": "NEEDS TRANSLATION", - "Rep. Pen. Presence": "NEEDS TRANSLATION", - "Enter it in the box below:": "NEEDS TRANSLATION", - "separate with commas w/o space between": "NEEDS TRANSLATION", - "Document": "NEEDS TRANSLATION", - "Suggest replies": "NEEDS TRANSLATION", - "Show suggested replies. Not all bots support this.": "NEEDS TRANSLATION", - "Use 'Unlocked Context' to enable chunked generation.": "NEEDS TRANSLATION", - "It extends the context window in exchange for reply generation speed.": "NEEDS TRANSLATION", - "Continue": "NEEDS TRANSLATION", - "Editing:": "NEEDS TRANSLATION", - "AI reply prefix": "NEEDS TRANSLATION", - "Custom Stopping Strings": "NEEDS TRANSLATION", - "JSON serialized array of strings": "NEEDS TRANSLATION", - "words you dont want generated separated by comma ','": "NEEDS TRANSLATION", - "Extensions URL": "NEEDS TRANSLATION", - "API Key": "NEEDS TRANSLATION", - "Enter your name": "NEEDS TRANSLATION", - "Name this character": "NEEDS TRANSLATION", - "Search / Create Tags": "NEEDS TRANSLATION", - "Describe your character's physical and mental traits here.": "NEEDS TRANSLATION", - "This will be the first message from the character that starts every chat.": "NEEDS TRANSLATION", - "Chat Name (Optional)": "NEEDS TRANSLATION", - "Filter...": "NEEDS TRANSLATION", - "Search...": "NEEDS TRANSLATION", - "Any contents here will replace the default Main Prompt used for this character. (v2 spec: system_prompt)": "NEEDS TRANSLATION", - "Any contents here will replace the default Jailbreak Prompt used for this character. (v2 spec: post_history_instructions)": "NEEDS TRANSLATION", - "(Botmaker's name / Contact Info)": "NEEDS TRANSLATION", - "(If you want to track character versions)": "NEEDS TRANSLATION", - "(Describe the bot, give use tips, or list the chat models it has been tested on. This will be displayed in the character list.)": "NEEDS TRANSLATION", - "(Write a comma-separated list of tags)": "NEEDS TRANSLATION", - "(A brief description of the personality)": "NEEDS TRANSLATION", - "(Circumstances and context of the interaction)": "NEEDS TRANSLATION", - "(Examples of chat dialog. Begin each example with START on a new line.)": "NEEDS TRANSLATION", - "Injection text (supports parameters)": "NEEDS TRANSLATION", - "Injection depth": "NEEDS TRANSLATION", - "Type here...": "NEEDS TRANSLATION", - "Comma separated (required)": "NEEDS TRANSLATION", - "Comma separated (ignored if empty)": "NEEDS TRANSLATION", - "What this keyword should mean to the AI, sent verbatim": "NEEDS TRANSLATION", - "Not sent to the AI": "NEEDS TRANSLATION", - "(This will be the first message from the character that starts every chat)": "NEEDS TRANSLATION", - "Not connected to API!": "NEEDS TRANSLATION", - "AI Response Configuration": "NEEDS TRANSLATION", - "AI Configuration panel will stay open": "NEEDS TRANSLATION", - "Update current preset": "NEEDS TRANSLATION", - "Create new preset": "NEEDS TRANSLATION", - "Import preset": "NEEDS TRANSLATION", - "Export preset": "NEEDS TRANSLATION", - "Delete the preset": "NEEDS TRANSLATION", - "NSFW block goes first in the resulting prompt": "NEEDS TRANSLATION", - "Enables OpenAI completion streaming": "NEEDS TRANSLATION", - "Wrap user messages in quotes before sending": "NEEDS TRANSLATION", - "Restore default prompt": "NEEDS TRANSLATION", - "New preset": "NEEDS TRANSLATION", - "Delete preset": "NEEDS TRANSLATION", - "Restore default jailbreak": "NEEDS TRANSLATION", - "Restore default reply": "NEEDS TRANSLATION", - "Restore defaul note": "NEEDS TRANSLATION", - "API Connections": "NEEDS TRANSLATION", - "Can help with bad responses by queueing only the approved workers. May slowdown the response time.": "NEEDS TRANSLATION", - "Clear your API key": "NEEDS TRANSLATION", - "Refresh models": "NEEDS TRANSLATION", - "Get your OpenRouter API token using OAuth flow. You will be redirected to openrouter.ai": "NEEDS TRANSLATION", - "Verifies your API connection by sending a short test message. Be aware that you'll be credited for it!": "NEEDS TRANSLATION", - "Create New": "NEEDS TRANSLATION", - "Edit": "NEEDS TRANSLATION", - "World Info & Soft Prompts": "NEEDS TRANSLATION", - "Locked = World Editor will stay open": "NEEDS TRANSLATION", - "Entries can activate other entries by mentioning their keywords": "NEEDS TRANSLATION", - "Lookup for the entry keys in the context will respect the case": "NEEDS TRANSLATION", - "If the entry key consists of only one word, it would not be matched as part of other words": "NEEDS TRANSLATION", - "Open all Entries": "NEEDS TRANSLATION", - "Close all Entries": "NEEDS TRANSLATION", - "Create": "NEEDS TRANSLATION", - "Import World Info": "NEEDS TRANSLATION", - "Export World Info": "NEEDS TRANSLATION", - "Delete World Info": "NEEDS TRANSLATION", - "Rename World Info": "NEEDS TRANSLATION", - "Save changes to a new theme file": "NEEDS TRANSLATION", - "removes blur and uses alternative background color for divs": "NEEDS TRANSLATION", - "If checked and the character card contains a prompt override (System Prompt), use that instead.": "NEEDS TRANSLATION", - "If checked and the character card contains a jailbreak override (Post History Instruction), use that instead.": "NEEDS TRANSLATION", - "AI Response Formatting": "NEEDS TRANSLATION", - "Change Background Image": "NEEDS TRANSLATION", - "Extensions": "NEEDS TRANSLATION", - "Click to set a new User Name": "NEEDS TRANSLATION", - "Click to lock your selected persona to the current chat. Click again to remove the lock.": "NEEDS TRANSLATION", - "Click to set user name for all messages": "NEEDS TRANSLATION", - "Create a dummy persona": "NEEDS TRANSLATION", - "Character Management": "NEEDS TRANSLATION", - "Locked = Character Management panel will stay open": "NEEDS TRANSLATION", - "Select/Create Characters": "NEEDS TRANSLATION", - "Token counts may be inaccurate and provided just for reference.": "NEEDS TRANSLATION", - "Click to select a new avatar for this character": "NEEDS TRANSLATION", - "Add to Favorites": "NEEDS TRANSLATION", - "Advanced Definition": "NEEDS TRANSLATION", - "Character Lore": "NEEDS TRANSLATION", - "Export and Download": "NEEDS TRANSLATION", - "Duplicate Character": "NEEDS TRANSLATION", - "Create Character": "NEEDS TRANSLATION", - "Delete Character": "NEEDS TRANSLATION", - "View all tags": "NEEDS TRANSLATION", - "Click to set additional greeting messages": "NEEDS TRANSLATION", - "Show / Hide Description and First Message": "NEEDS TRANSLATION", - "Click to select a new avatar for this group": "NEEDS TRANSLATION", - "Set a group chat scenario": "NEEDS TRANSLATION", - "Restore collage avatar": "NEEDS TRANSLATION", - "Create New Character": "NEEDS TRANSLATION", - "Import Character from File": "NEEDS TRANSLATION", - "Import content from external URL": "NEEDS TRANSLATION", - "Create New Chat Group": "NEEDS TRANSLATION", - "Characters sorting order": "NEEDS TRANSLATION", - "Add chat injection": "NEEDS TRANSLATION", - "Remove injection": "NEEDS TRANSLATION", - "Remove": "NEEDS TRANSLATION", - "Select a World Info file for": "NEEDS TRANSLATION", - "Primary Lorebook": "NEEDS TRANSLATION", - "A selected World Info will be bound to this character as its own Lorebook.": "NEEDS TRANSLATION", - "When generating an AI reply, it will be combined with the entries from a global World Info selector.": "NEEDS TRANSLATION", - "Exporting a character would also export the selected Lorebook file embedded in the JSON data.": "NEEDS TRANSLATION", - "Additional Lorebooks": "NEEDS TRANSLATION", - "Associate one or more auxillary Lorebooks with this character.": "NEEDS TRANSLATION", - "NOTE: These choices are optional and won't be preserved on character export!": "NEEDS TRANSLATION", - "Rename chat file": "NEEDS TRANSLATION", - "Export JSONL chat file": "NEEDS TRANSLATION", - "Download chat as plain text document": "NEEDS TRANSLATION", - "Delete chat file": "NEEDS TRANSLATION", - "Delete tag": "NEEDS TRANSLATION", - "Translate message": "NEEDS TRANSLATION", - "Generate Image": "NEEDS TRANSLATION", - "Narrate": "NEEDS TRANSLATION", - "Prompt": "NEEDS TRANSLATION", - "Create Bookmark": "NEEDS TRANSLATION", - "Copy": "NEEDS TRANSLATION", - "Open bookmark chat": "NEEDS TRANSLATION", - "Confirm": "NEEDS TRANSLATION", - "Copy this message": "NEEDS TRANSLATION", - "Delete this message": "NEEDS TRANSLATION", - "Move message up": "NEEDS TRANSLATION", - "Move message down": "NEEDS TRANSLATION", - "Enlarge": "NEEDS TRANSLATION", - "Temporarily disable automatic replies from this character": "NEEDS TRANSLATION", - "Enable automatic replies from this character": "NEEDS TRANSLATION", - "Trigger a message from this character": "NEEDS TRANSLATION", - "Move up": "NEEDS TRANSLATION", - "Move down": "NEEDS TRANSLATION", - "View character card": "NEEDS TRANSLATION", - "Remove from group": "NEEDS TRANSLATION", - "Add to group": "NEEDS TRANSLATION", - "Add": "NEEDS TRANSLATION", - "Abort request": "NEEDS TRANSLATION", - "Send a message": "NEEDS TRANSLATION", - "Ask AI to write your message for you": "NEEDS TRANSLATION", - "Continue the last message": "NEEDS TRANSLATION", - "Bind user name to that avatar": "NEEDS TRANSLATION", - "Select this as default persona for the new chats.": "NEEDS TRANSLATION", - "Change persona image": "NEEDS TRANSLATION", - "Delete persona": "NEEDS TRANSLATION" + "No connection": "Desconectado", + "oobabooga/text-generation-webui": "oobabooga/text-generation-webui", + "Make sure you run it with": "Asegúrate de usar el argumento --api cuando se ejecute", + "Blocking API url": "API URL", + "Streaming API url": "Streaming API URL", + "to get your OpenAI API key.": "para conseguir tu clave API de OpenAI", + "OpenAI Model": "Modelo AI de OpenAI", + "View API Usage Metrics": "Ver métricas de uso de la API", + "Bot": "Bot", + "Auto-connect to Last Server": "Auto-conectarse con el último servidor", + "View hidden API keys": "Ver claves API ocultas", + "Advanced Formatting": "Formateo avanzado", + "AutoFormat Overrides": "Autoformateo de overrides", + "Samplers Order": "Orden de Samplers", + "Samplers will be applied in a top-down order. Use with caution.": "Los Samplers serán aplicados de orden superior a inferior. \nUsa con precaución", + "Load koboldcpp order": "Cargar el orden de koboldcpp", + "Repetition Penalty": "Repetition Penalty", + "Epsilon Cutoff": "Epsilon Cutoff", + "Eta Cutoff": "Eta Cutoff", + "Rep. Pen. Range.": "Rep. Pen. Range.", + "Rep. Pen. Freq.": "Rep. Pen. Freq.", + "Rep. Pen. Presence": "Rep. Pen. Presence." } } \ No newline at end of file From 085e92a43efe4a99563b215ae06a1519b9b30948 Mon Sep 17 00:00:00 2001 From: Cohee <18619528+Cohee1207@users.noreply.github.com> Date: Wed, 30 Aug 2023 12:03:18 +0300 Subject: [PATCH 17/68] Escape prompt manager names --- public/scripts/PromptManager.js | 9 +++++---- public/scripts/utils.js | 4 ++++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/public/scripts/PromptManager.js b/public/scripts/PromptManager.js index 4e3ca2a35..b490482fc 100644 --- a/public/scripts/PromptManager.js +++ b/public/scripts/PromptManager.js @@ -4,7 +4,7 @@ import { callPopup, event_types, eventSource, is_send_press, main_api, substitut import { is_group_generating } from "./group-chats.js"; import { TokenHandler } from "./openai.js"; import { power_user } from "./power-user.js"; -import { debounce, waitUntilCondition } from "./utils.js"; +import { debounce, waitUntilCondition, escapeHtml } from "./utils.js"; function debouncePromise(func, delay) { let timeoutId; @@ -1291,7 +1291,7 @@ PromptManagerModule.prototype.renderPromptManager = function () { const prompts = [...this.serviceSettings.prompts] .filter(prompt => prompt && !prompt?.system_prompt) .sort((promptA, promptB) => promptA.name.localeCompare(promptB.name)) - .reduce((acc, prompt) => acc + ``, ''); + .reduce((acc, prompt) => acc + ``, ''); const footerHtml = `