Added translation to reasoning block (#3617)

* Added translate to reasoning block

* Added mising reset value

* Shortcut nullable type

* Added reasoning edited/deleted events, better naming

* Fixed async call

* Added await to saveChat calls

* Exported updateReasoningUI

* Removed translated reasoning on edit if auto mode is none

* Added new value check before updating reasoning block, fixed an issue that display value stays same when we edit the message.

* Translate reasoning before the main message

* Fixed auto mode translate for reasoning message

* Translate reasoning first. Prevent out of bounds access

* Fix translating reasoning on swipe generation

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
This commit is contained in:
bmen25124
2025-03-06 22:30:17 +03:00
committed by GitHub
parent 4d81dfb085
commit 50f1e3f0f2
4 changed files with 127 additions and 13 deletions

View File

@ -79,6 +79,7 @@ import { timestampToMoment, uuidv4 } from './utils.js';
import { getGlobalVariable, getLocalVariable, setGlobalVariable, setLocalVariable } from './variables.js';
import { convertCharacterBook, loadWorldInfo, saveWorldInfo, updateWorldInfoList } from './world-info.js';
import { ChatCompletionService, TextCompletionService } from './custom-request.js';
import { updateReasoningUI } from './reasoning.js';
export function getContext() {
return {
@ -211,6 +212,7 @@ export function getContext() {
clearChat,
ChatCompletionService,
TextCompletionService,
updateReasoningUI,
unshallowCharacter,
unshallowGroupMembers,
};