mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Rebranding
This commit is contained in:
10
package-lock.json
generated
10
package-lock.json
generated
@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "TavernAI",
|
||||
"version": "1.3.0",
|
||||
"name": "sillytavern",
|
||||
"version": "1.4.1",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "TavernAI",
|
||||
"version": "1.3.0",
|
||||
"name": "sillytavern",
|
||||
"version": "1.4.1",
|
||||
"dependencies": {
|
||||
"@dqbd/tiktoken": "^1.0.2",
|
||||
"axios": "^1.3.4",
|
||||
@ -34,7 +34,7 @@
|
||||
"ws": "^8.13.0"
|
||||
},
|
||||
"bin": {
|
||||
"TavernAI": "server.js"
|
||||
"sillytavern": "server.js"
|
||||
}
|
||||
},
|
||||
"node_modules/@dqbd/tiktoken": {
|
||||
|
@ -30,10 +30,10 @@
|
||||
"xml2js": "^0.5.0"
|
||||
}
|
||||
},
|
||||
"name": "TavernAI",
|
||||
"version": "1.3.0",
|
||||
"name": "sillytavern",
|
||||
"version": "1.4.1",
|
||||
"bin": {
|
||||
"TavernAI": "server.js"
|
||||
"sillytavern": "server.js"
|
||||
},
|
||||
"rules": {
|
||||
"no-path-concat": "off",
|
||||
|
@ -1,6 +1,6 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>TavernAI - Note - Character Descriptions</title>
|
||||
<title>Character Descriptions</title>
|
||||
<link rel="stylesheet" href="/css/notes.css">
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
@ -1,6 +1,6 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>TavernAI - Note - Import Chat</title>
|
||||
<title>Import Chat</title>
|
||||
<link rel="stylesheet" href="/css/notes.css">
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
@ -12,7 +12,7 @@
|
||||
<div id="main">
|
||||
<div id="content">
|
||||
<h2>Chat import</h2>
|
||||
<h3>Import chats into TavernAI</h3>
|
||||
<h3>Import chats into SillyTavern</h3>
|
||||
<p>To import Character.AI chats, use this tool: <a href="https://github.com/0x000011b/characterai-dumper">https://github.com/0x000011b/characterai-dumper</a>.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1,6 +1,6 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>TavernAI - Note - Example Dialogues</title>
|
||||
<title>Example Dialogues</title>
|
||||
<link rel="stylesheet" href="/css/notes.css">
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
@ -1,6 +1,6 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>TavernAI - Note - Scenario</title>
|
||||
<title>Scenario</title>
|
||||
<link rel="stylesheet" href="/css/notes.css">
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
@ -14,7 +14,7 @@
|
||||
<h2>World Info</h2>
|
||||
<h4>World Info enhances AI's understanding of the details in your world.</h4>
|
||||
<p>It functions like a dynamic dictionary that only inserts relevant information from World Info entries when keywords associated with the entries are present in the message text.</p>
|
||||
<p>The TavernAI engine activates and seamlessly integrates the appropriate lore into the prompt, providing background information to the AI.</p>
|
||||
<p>SillyTavern activates and seamlessly integrates the appropriate lore into the prompt, providing background information to the AI.</p>
|
||||
<p><i>It is important to note that while World Info helps guide the AI towards your desired lore, it does not guarantee its appearance in the generated output messages.</i></p>
|
||||
|
||||
<h3>Pro Tips</h3>
|
||||
|
@ -15,7 +15,7 @@
|
||||
<div id="content">
|
||||
<h2>Scan Depth</h2>
|
||||
<h4>Defines how many messages in the chat history should be scanned for World Info keys.</h4>
|
||||
<p>If set to 1, then TavernAI only scans the message you send and the most recent reply.</p>
|
||||
<p>If set to 1, then SillyTavern only scans the message you send and the most recent reply.</p>
|
||||
<p>This stacks up to 10 message pairs it total.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1,6 +1,6 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>TavernAI - Note - Personality Summary</title>
|
||||
<title>Personality Summary</title>
|
||||
<link rel="stylesheet" href="/css/notes.css">
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
@ -1,6 +1,6 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>TavernAI - Note - First Message</title>
|
||||
<title>First Message</title>
|
||||
<link rel="stylesheet" href="/css/notes.css">
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
@ -1,7 +1,7 @@
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<title>TavernAI - Note - KobolAI Settings</title>
|
||||
<title>KoboldAI Settings</title>
|
||||
<link rel="stylesheet" href="/css/notes.css">
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
@ -17,7 +17,7 @@
|
||||
<div id="content">
|
||||
<h2>KoboldAI Settings</h2>
|
||||
<p>Standard KoboldAI settings files are used here. To add your own settings, simply add the file .settings
|
||||
in TavernAI\public\KoboldAI Settings
|
||||
in SillyTavern\public\KoboldAI Settings
|
||||
</p>
|
||||
<h3>Temperature</h3>
|
||||
<p>Value from 0.1 to 2.0. Lower value - the answers are more logical, but less creative. Higher value - the
|
||||
@ -34,7 +34,7 @@
|
||||
The larger the parameter value, the longer the generation time takes.</p>
|
||||
<h3>Context size</h3>
|
||||
<p>How much will the AI remember. Context size also affects the speed of generation.<br><br>
|
||||
<u>Important</u>: The setting of Context Size in TavernAI GUI overrides the setting for KoboldAI GUI
|
||||
<u>Important</u>: The setting of Context Size in SillyTavern GUI overrides the setting for KoboldAI GUI
|
||||
</p>
|
||||
|
||||
<h2>Advanced Settings</h2>
|
||||
|
@ -1,6 +1,6 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>TavernAI - Note - Novel AI API Key</title>
|
||||
<title>NovelAI API Key</title>
|
||||
<link rel="stylesheet" href="/css/notes.css">
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
@ -1,6 +1,6 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>TavernAI - Note - NovelAI Settings</title>
|
||||
<title>NovelAI Settings</title>
|
||||
<link rel="stylesheet" href="/css/notes.css">
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
@ -13,7 +13,7 @@
|
||||
<div id="content">
|
||||
<h2>NovelAI settings</h2>
|
||||
<p>
|
||||
The files with the settings are here (TavernAI\public\NovelAI Settings).<br>
|
||||
The files with the settings are here (SillyTavern\public\NovelAI Settings).<br>
|
||||
You can also manually add your own settings files.
|
||||
</p>
|
||||
<h3>Temperature</h3>
|
||||
|
@ -1,6 +1,6 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>TavernAI - Note - NovelAI Models</title>
|
||||
<title>NovelAI Models</title>
|
||||
<link rel="stylesheet" href="/css/notes.css">
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
@ -1,6 +1,6 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>TavernAI - Note - Anchors</title>
|
||||
<title>Anchors</title>
|
||||
<link rel="stylesheet" href="/css/notes.css">
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
@ -16,7 +16,7 @@
|
||||
<div id="main">
|
||||
<div id="content">
|
||||
<h2>Message Sound</h2>
|
||||
<p>To play your own custom sound on receiving a new message from bot, replace the following MP3 file in your TavernAI folder:</p>
|
||||
<p>To play your own custom sound on receiving a new message from bot, replace the following MP3 file in your SillyTavern folder:</p>
|
||||
<code>
|
||||
public/sounds/message.mp3
|
||||
</code>
|
||||
@ -24,7 +24,7 @@
|
||||
Plays at 80% volume.
|
||||
</p>
|
||||
<p>
|
||||
If "Background Sound Only" option is enabled, the sound plays only if TavernAI window is <b>unfocused</b>.
|
||||
If "Background Sound Only" option is enabled, the sound plays only if SillyTavern window is <b>unfocused</b>.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -16,7 +16,7 @@
|
||||
<div id="main">
|
||||
<div id="content">
|
||||
<h2>Multigen</h2>
|
||||
<p>TavernAI tries to create faster and longer responses by chaining the generation using smaller batches.</p>
|
||||
<p>SillyTavern tries to create faster and longer responses by chaining the generation using smaller batches.</p>
|
||||
<h3>Default settings:</h3>
|
||||
<p>First batch = 50 tokens</p>
|
||||
<p>Next batches = 30 tokens</p>
|
||||
|
@ -158,15 +158,15 @@ export {
|
||||
}
|
||||
|
||||
// API OBJECT FOR EXTERNAL WIRING
|
||||
window["TavernAI"] = {};
|
||||
window["SillyTavern"] = {};
|
||||
|
||||
let converter = new showdown.Converter({ emoji: "true" });
|
||||
const gpt3 = new GPT3BrowserTokenizer({ type: 'gpt3' });
|
||||
/* let bg_menu_toggle = false; */
|
||||
const systemUserName = "TavernAI";
|
||||
const systemUserName = "SillyTavern";
|
||||
let default_user_name = "You";
|
||||
let name1 = default_user_name;
|
||||
let name2 = "TavernAI";
|
||||
let name2 = "SillyTavern";
|
||||
let chat = [];
|
||||
let safetychat = [
|
||||
{
|
||||
@ -248,7 +248,7 @@ const system_messages = {
|
||||
is_user: false,
|
||||
is_name: true,
|
||||
mes: [
|
||||
'Welcome to TavernAI! In order to begin chatting:',
|
||||
'Welcome to SillyTavern! In order to begin chatting:',
|
||||
'<ul>',
|
||||
'<li>Connect to one of the supported generation APIs</li>',
|
||||
'<li>Create or pick a character from the list</li>',
|
||||
@ -3454,7 +3454,7 @@ function isHordeGenerationNotAllowed() {
|
||||
return false;
|
||||
}
|
||||
|
||||
window["TavernAI"].getContext = function () {
|
||||
window["SillyTavern"].getContext = function () {
|
||||
return {
|
||||
chat: chat,
|
||||
characters: characters,
|
||||
|
78
server.js
78
server.js
@ -183,8 +183,8 @@ app.use(function (req, res, next) { //Security
|
||||
|
||||
//clientIp = req.connection.remoteAddress.split(':').pop();
|
||||
if (whitelistMode === true && !whitelist.includes(clientIp)) {
|
||||
console.log('Forbidden: Connection attempt from ' + clientIp + '. If you are attempting to connect, please add your IP address in whitelist or disable whitelist mode in config.conf in root of TavernAI folder.\n');
|
||||
return res.status(403).send('<b>Forbidden</b>: Connection attempt from <b>' + clientIp + '</b>. If you are attempting to connect, please add your IP address in whitelist or disable whitelist mode in config.conf in root of TavernAI folder.');
|
||||
console.log('Forbidden: Connection attempt from ' + clientIp + '. If you are attempting to connect, please add your IP address in whitelist or disable whitelist mode in config.conf in root of SillyTavern folder.\n');
|
||||
return res.status(403).send('<b>Forbidden</b>: Connection attempt from <b>' + clientIp + '</b>. If you are attempting to connect, please add your IP address in whitelist or disable whitelist mode in config.conf in root of SillyTavern folder.');
|
||||
}
|
||||
next();
|
||||
});
|
||||
@ -368,7 +368,7 @@ app.post("/generate_textgenerationwebui", jsonParser, async function (request, r
|
||||
if (!!request.header('X-Response-Streaming')) {
|
||||
const fn_index = Number(request.header('X-Gradio-Streaming-Function'));
|
||||
let isStreamingStopped = false;
|
||||
request.socket.on('close', function() {
|
||||
request.socket.on('close', function () {
|
||||
isStreamingStopped = true;
|
||||
});
|
||||
|
||||
@ -1598,18 +1598,18 @@ app.post("/importchat", urlencodedParser, function (request, response) {
|
||||
|
||||
const errors = [];
|
||||
newChats.forEach(chat => fs.writeFile(
|
||||
chatsPath + avatar_url + '/' + ch_name + ' - ' + humanizedISO8601DateTime() + ' imported.jsonl',
|
||||
chat.map(JSON.stringify).join('\n'),
|
||||
'utf8',
|
||||
(err) => err ?? errors.push(err)
|
||||
)
|
||||
chatsPath + avatar_url + '/' + ch_name + ' - ' + humanizedISO8601DateTime() + ' imported.jsonl',
|
||||
chat.map(JSON.stringify).join('\n'),
|
||||
'utf8',
|
||||
(err) => err ?? errors.push(err)
|
||||
)
|
||||
);
|
||||
|
||||
if (0 < errors.length) {
|
||||
response.send('Errors occurred while writing character files. Errors: ' + JSON.stringify(errors));
|
||||
}
|
||||
|
||||
response.send({res: true});
|
||||
response.send({ res: true });
|
||||
} else {
|
||||
response.send({ error: true });
|
||||
}
|
||||
@ -1840,7 +1840,7 @@ app.post('/deletegroup', jsonParser, async (request, response) => {
|
||||
|
||||
const POE_DEFAULT_BOT = 'a2';
|
||||
|
||||
async function getPoeClient(token, useCache=false) {
|
||||
async function getPoeClient(token, useCache = false) {
|
||||
let client = new poe.Client(false, useCache);
|
||||
await client.init(token);
|
||||
return client;
|
||||
@ -1906,7 +1906,7 @@ app.post('/generate_poe', jsonParser, async (request, response) => {
|
||||
|
||||
if (streaming) {
|
||||
let isStreamingStopped = false;
|
||||
request.socket.on('close', function() {
|
||||
request.socket.on('close', function () {
|
||||
isStreamingStopped = true;
|
||||
client.abortController.abort();
|
||||
});
|
||||
@ -1972,17 +1972,17 @@ app.get('/get_sprites', jsonParser, function (request, response) {
|
||||
try {
|
||||
if (fs.existsSync(spritesPath) && fs.statSync(spritesPath).isDirectory()) {
|
||||
sprites = fs.readdirSync(spritesPath)
|
||||
.filter(file => {
|
||||
const mimeType = mime.lookup(file);
|
||||
return mimeType && mimeType.startsWith('image/');
|
||||
})
|
||||
.map((file) => {
|
||||
const pathToSprite = path.join(spritesPath, file);
|
||||
return {
|
||||
label: path.parse(pathToSprite).name.toLowerCase(),
|
||||
path: `/characters/${name}/${file}`,
|
||||
};
|
||||
});
|
||||
.filter(file => {
|
||||
const mimeType = mime.lookup(file);
|
||||
return mimeType && mimeType.startsWith('image/');
|
||||
})
|
||||
.map((file) => {
|
||||
const pathToSprite = path.join(spritesPath, file);
|
||||
return {
|
||||
label: path.parse(pathToSprite).name.toLowerCase(),
|
||||
path: `/characters/${name}/${file}`,
|
||||
};
|
||||
});
|
||||
}
|
||||
}
|
||||
catch (err) {
|
||||
@ -2152,12 +2152,42 @@ app.post("/getstatus_openai", jsonParser, function (request, response_getstatus_
|
||||
});
|
||||
});
|
||||
|
||||
// Shamelessly stolen from Agnai
|
||||
app.post("/openai_usage", jsonParser, async function (_, response) {
|
||||
if (!request.body) return response.sendStatus(400);
|
||||
const key = request.body.key;
|
||||
const api_url = new URL(request.body.reverse_proxy || api_openai).toString();
|
||||
|
||||
const headers = {
|
||||
'Content-Type': 'application/json',
|
||||
Authorization: `Bearer ${key}`,
|
||||
};
|
||||
|
||||
const date = new Date();
|
||||
date.setDate(1);
|
||||
const start_date = date.toISOString().slice(0, 10);
|
||||
|
||||
date.setMonth(date.getMonth() + 1);
|
||||
const end_date = date.toISOString().slice(0, 10);
|
||||
|
||||
try {
|
||||
const res = await getAsync(
|
||||
`${api_url}/dashboard/billing/usage?start_date=${start_date}&end_date=${end_date}`,
|
||||
{ headers },
|
||||
);
|
||||
return response.send(res);
|
||||
}
|
||||
catch {
|
||||
return response.sendStatus(400);
|
||||
}
|
||||
});
|
||||
|
||||
app.post("/generate_openai", jsonParser, function (request, response_generate_openai) {
|
||||
if (!request.body) return response_generate_openai.sendStatus(400);
|
||||
const api_url = new URL(request.body.reverse_proxy || api_openai).toString();
|
||||
|
||||
const controller = new AbortController();
|
||||
request.socket.on('close', function() {
|
||||
request.socket.on('close', function () {
|
||||
controller.abort();
|
||||
});
|
||||
|
||||
@ -2330,7 +2360,7 @@ app.listen(server_port, (listen ? '0.0.0.0' : '127.0.0.1'), async function () {
|
||||
|
||||
console.log('Launching...');
|
||||
if (autorun) open('http://127.0.0.1:' + server_port);
|
||||
console.log('TavernAI started: http://127.0.0.1:' + server_port);
|
||||
console.log('SillyTavern started: http://127.0.0.1:' + server_port);
|
||||
if (fs.existsSync('public/characters/update.txt') && !is_colab) {
|
||||
convertStage1();
|
||||
}
|
||||
|
Reference in New Issue
Block a user