From 482bea292a0880999f68dee8510a7508745c0d49 Mon Sep 17 00:00:00 2001
From: deffcolony <61471128+deffcolony@users.noreply.github.com>
Date: Tue, 2 Jan 2024 17:41:41 +0100
Subject: [PATCH 1/7] New screenshots
---
.github/readme.md | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/.github/readme.md b/.github/readme.md
index 8727cb69c..f3ddcc7c2 100644
--- a/.github/readme.md
+++ b/.github/readme.md
@@ -282,8 +282,9 @@ You can find them archived here:
## Screenshots
-
-
+
+
+
## License and credits
From 7104daf7f092735331d17f5d2e62e211c110c0c0 Mon Sep 17 00:00:00 2001
From: RossAscends <124905043+RossAscends@users.noreply.github.com>
Date: Mon, 8 Jan 2024 08:05:25 +0900
Subject: [PATCH 2/7] Update readme.md with discord permalink
---
.github/readme.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/readme.md b/.github/readme.md
index f3ddcc7c2..cb502ae43 100644
--- a/.github/readme.md
+++ b/.github/readme.md
@@ -51,7 +51,7 @@ Since Tavern is only a user interface, it has tiny hardware requirements, it wil
Get support, share favorite characters and prompts:
-### [Join](https://discord.gg/RZdyAEUPvj)
+### [Join](https://discord.gg/sillytavern)
***
From ce4c1b8d01de84a44095e85cb144534cd534e8bb Mon Sep 17 00:00:00 2001
From: Cohee <18619528+Cohee1207@users.noreply.github.com>
Date: Thu, 11 Jan 2024 15:59:00 +0200
Subject: [PATCH 3/7] MistralAI monkey patch
---
src/endpoints/backends/chat-completions.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/endpoints/backends/chat-completions.js b/src/endpoints/backends/chat-completions.js
index 712ed4485..9a5672f8f 100644
--- a/src/endpoints/backends/chat-completions.js
+++ b/src/endpoints/backends/chat-completions.js
@@ -478,7 +478,7 @@ async function sendMistralAIRequest(request, response) {
'top_p': request.body.top_p,
'max_tokens': request.body.max_tokens,
'stream': request.body.stream,
- 'safe_mode': request.body.safe_mode,
+ //'safe_mode': request.body.safe_mode,
'random_seed': request.body.seed === -1 ? undefined : request.body.seed,
};
From cd88702e33c6cb58e844a47e2fc916f5237adc3a Mon Sep 17 00:00:00 2001
From: Cohee <18619528+Cohee1207@users.noreply.github.com>
Date: Fri, 12 Jan 2024 17:40:29 +0200
Subject: [PATCH 4/7] Mistral API being weird, part 2
---
src/endpoints/backends/chat-completions.js | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/endpoints/backends/chat-completions.js b/src/endpoints/backends/chat-completions.js
index 9a5672f8f..5f6166e52 100644
--- a/src/endpoints/backends/chat-completions.js
+++ b/src/endpoints/backends/chat-completions.js
@@ -540,6 +540,7 @@ router.post('/status', jsonParser, async function (request, response_getstatus_o
} else if (request.body.chat_completion_source === CHAT_COMPLETION_SOURCES.MISTRALAI) {
api_url = 'https://api.mistral.ai/v1';
api_key_openai = readSecret(SECRET_KEYS.MISTRALAI);
+ headers = { 'Content-Length': '0' }; // WTF?
} else if (request.body.chat_completion_source === CHAT_COMPLETION_SOURCES.CUSTOM) {
api_url = request.body.custom_url;
api_key_openai = readSecret(SECRET_KEYS.CUSTOM);
From b528520693f00bc547e502b7ad7614eb02c45536 Mon Sep 17 00:00:00 2001
From: Juha Jeronen
Date: Fri, 12 Jan 2024 18:26:14 +0200
Subject: [PATCH 5/7] read and send talkinghead per-character configs
---
.../scripts/extensions/expressions/index.js | 65 +++++++++++++++++++
1 file changed, 65 insertions(+)
diff --git a/public/scripts/extensions/expressions/index.js b/public/scripts/extensions/expressions/index.js
index 451577a43..ee3e9b5a1 100644
--- a/public/scripts/extensions/expressions/index.js
+++ b/public/scripts/extensions/expressions/index.js
@@ -422,6 +422,8 @@ async function loadTalkingHead() {
const spriteFolderName = getSpriteFolderName();
const talkingheadPath = `/characters/${encodeURIComponent(spriteFolderName)}/talkinghead.png`;
+ const emotionsSettingsPath = `/characters/${encodeURIComponent(spriteFolderName)}/_emotions.json`;
+ const animatorSettingsPath = `/characters/${encodeURIComponent(spriteFolderName)}/_animator.json`;
try {
const spriteResponse = await fetch(talkingheadPath);
@@ -450,6 +452,69 @@ async function loadTalkingHead() {
const loadResponseText = await loadResponse.text();
console.log(`Load talkinghead response: ${loadResponseText}`);
+ // Optional: per-character emotion templates
+ let emotionsSettings;
+ try {
+ const emotionsResponse = await fetch(emotionsSettingsPath);
+ if (emotionsResponse.ok) {
+ emotionsSettings = await emotionsResponse.json();
+ console.log(`Loaded ${emotionsSettingsPath}`);
+ } else {
+ throw new Error();
+ }
+ }
+ catch (error) {
+ emotionsSettings = {}; // blank -> use server defaults (to unload the previous character's customizations)
+ console.log(`No valid config at ${emotionsSettingsPath}, using server defaults`);
+ }
+ try {
+ const url = new URL(getApiUrl());
+ url.pathname = '/api/talkinghead/load_emotion_templates';
+ const apiResult = await doExtrasFetch(url, {
+ method: 'POST',
+ headers: {
+ 'Content-Type': 'application/json',
+ 'Bypass-Tunnel-Reminder': 'bypass',
+ },
+ body: JSON.stringify(emotionsSettings),
+ });
+ }
+ catch (error) {
+ // it's ok if not supported
+ console.log('Failed to send _emotions.json (backend too old?), ignoring');
+ }
+
+ // Optional: per-character animator and postprocessor config
+ let animatorSettings;
+ try {
+ const animatorResponse = await fetch(animatorSettingsPath);
+ if (animatorResponse.ok) {
+ animatorSettings = await animatorResponse.json();
+ console.log(`Loaded ${animatorSettingsPath}`);
+ } else {
+ throw new Error();
+ }
+ }
+ catch (error) {
+ animatorSettings = {}; // blank -> use server defaults (to unload the previous character's customizations)
+ console.log(`No valid config at ${animatorSettingsPath}, using server defaults`);
+ }
+ try {
+ const url = new URL(getApiUrl());
+ url.pathname = '/api/talkinghead/load_animator_settings';
+ const apiResult = await doExtrasFetch(url, {
+ method: 'POST',
+ headers: {
+ 'Content-Type': 'application/json',
+ 'Bypass-Tunnel-Reminder': 'bypass',
+ },
+ body: JSON.stringify(animatorSettings),
+ });
+ }
+ catch (error) {
+ // it's ok if not supported
+ console.log('Failed to send _animator.json (backend too old?), ignoring');
+ }
} catch (error) {
console.error(`Error loading talkinghead image: ${talkingheadPath} - ${error}`);
}
From d592e26e24a21b89adddcebf8620646cf59dcea6 Mon Sep 17 00:00:00 2001
From: Cohee <18619528+Cohee1207@users.noreply.github.com>
Date: Sun, 14 Jan 2024 19:40:12 +0200
Subject: [PATCH 6/7] Fix conditional access
---
src/endpoints/backends/chat-completions.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/endpoints/backends/chat-completions.js b/src/endpoints/backends/chat-completions.js
index 1e7cc1867..cef8b906d 100644
--- a/src/endpoints/backends/chat-completions.js
+++ b/src/endpoints/backends/chat-completions.js
@@ -334,7 +334,7 @@ async function sendMakerSuiteRequest(request, response) {
}
const responseContent = candidates[0].content ?? candidates[0].output;
- const responseText = typeof responseContent === 'string' ? responseContent : responseContent.parts?.[0]?.text;
+ const responseText = typeof responseContent === 'string' ? responseContent : responseContent?.parts?.[0]?.text;
if (!responseText) {
let message = 'MakerSuite Candidate text empty';
console.log(message, generateResponseJson);
From ed77f4763a46be0ea29f80477871ca40bc9aa8db Mon Sep 17 00:00:00 2001
From: Cohee <18619528+Cohee1207@users.noreply.github.com>
Date: Mon, 15 Jan 2024 03:45:31 +0200
Subject: [PATCH 7/7] #1696 Don't cancel generation on first Escape press if
editing a message
---
public/script.js | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/public/script.js b/public/script.js
index 3251c47fc..01cbf2c59 100644
--- a/public/script.js
+++ b/public/script.js
@@ -9292,13 +9292,16 @@ jQuery(async function () {
$(document).keyup(function (e) {
if (e.key === 'Escape') {
- if (power_user.auto_save_msg_edits === false) {
+ const isEditVisible = $('#curEditTextarea').is(':visible');
+ if (isEditVisible && power_user.auto_save_msg_edits === false) {
closeMessageEditor();
$('#send_textarea').focus();
+ return;
}
- if (power_user.auto_save_msg_edits === true) {
+ if (isEditVisible && power_user.auto_save_msg_edits === true) {
$(`#chat .mes[mesid="${this_edit_mes_id}"] .mes_edit_done`).click();
$('#send_textarea').focus();
+ return;
}
if (!this_edit_mes_id && $('#mes_stop').is(':visible')) {
$('#mes_stop').trigger('click');