mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Merge branch 'staging' into support-multiple-expressions
This commit is contained in:
@@ -1487,7 +1487,7 @@ jQuery(function () {
|
||||
...chat.filter(x => x?.extra?.type !== system_message_types.ASSISTANT_NOTE),
|
||||
];
|
||||
|
||||
download(JSON.stringify(chatToSave, null, 4), `Assistant - ${humanizedDateTime()}.json`, 'application/json');
|
||||
download(chatToSave.map((m) => JSON.stringify(m)).join('\n'), `Assistant - ${humanizedDateTime()}.jsonl`, 'application/json');
|
||||
});
|
||||
|
||||
// Do not change. #attachFile is added by extension.
|
||||
|
@@ -338,14 +338,15 @@ export class ReasoningHandler {
|
||||
return mesChanged;
|
||||
}
|
||||
|
||||
if (this.state === ReasoningState.None) {
|
||||
if (this.state === ReasoningState.None || this.#isHiddenReasoningModel) {
|
||||
// If streamed message starts with the opening, cut it out and put all inside reasoning
|
||||
if (message.mes.startsWith(power_user.reasoning.prefix) && message.mes.length > power_user.reasoning.prefix.length) {
|
||||
this.#isParsingReasoning = true;
|
||||
|
||||
// Manually set starting state here, as we might already have received the ending suffix
|
||||
this.state = ReasoningState.Thinking;
|
||||
this.startTime = this.initialTime;
|
||||
this.startTime = this.startTime ?? this.initialTime;
|
||||
this.endTime = null;
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -9,6 +9,9 @@ import { ensureImageFormatSupported, getBase64Async, humanFileSize } from './uti
|
||||
export let currentUser = null;
|
||||
export let accountsEnabled = false;
|
||||
|
||||
// Extend the session every 30 minutes
|
||||
const SESSION_EXTEND_INTERVAL = 30 * 60 * 1000;
|
||||
|
||||
/**
|
||||
* Enable or disable user account controls in the UI.
|
||||
* @param {boolean} isEnabled User account controls enabled
|
||||
@@ -894,6 +897,24 @@ async function slugify(text) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Pings the server to extend the user session.
|
||||
*/
|
||||
async function extendUserSession() {
|
||||
try {
|
||||
const response = await fetch('/api/ping?extend=1', {
|
||||
method: 'GET',
|
||||
headers: getRequestHeaders(),
|
||||
});
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error('Ping did not succeed', { cause: response.status });
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Failed to extend user session', error);
|
||||
}
|
||||
}
|
||||
|
||||
jQuery(() => {
|
||||
$('#logout_button').on('click', () => {
|
||||
logout();
|
||||
@@ -904,4 +925,9 @@ jQuery(() => {
|
||||
$('#account_button').on('click', () => {
|
||||
openUserProfile();
|
||||
});
|
||||
setInterval(async () => {
|
||||
if (currentUser) {
|
||||
await extendUserSession();
|
||||
}
|
||||
}, SESSION_EXTEND_INTERVAL);
|
||||
});
|
||||
|
Reference in New Issue
Block a user