mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Return type casts where they were
This commit is contained in:
@@ -372,8 +372,8 @@ router.post('/generate', jsonParser, async function (request, response) {
|
||||
}
|
||||
|
||||
if (request.body.api_type === TEXTGEN_TYPES.OLLAMA) {
|
||||
const keepAlive = getConfigValue('ollama.keepAlive', -1, 'number');
|
||||
const numBatch = getConfigValue('ollama.batchSize', -1, 'number');
|
||||
const keepAlive = Number(getConfigValue('ollama.keepAlive', -1, 'number'));
|
||||
const numBatch = Number(getConfigValue('ollama.batchSize', -1, 'number'));
|
||||
if (numBatch > 0) {
|
||||
request.body['num_batch'] = numBatch;
|
||||
}
|
||||
|
@@ -24,7 +24,7 @@ import { importRisuSprites } from './sprites.js';
|
||||
const defaultAvatarPath = './public/img/ai4.png';
|
||||
|
||||
// KV-store for parsed character data
|
||||
const cacheCapacity = getConfigValue('cardsCacheCapacity', 100, 'number'); // MB
|
||||
const cacheCapacity = Number(getConfigValue('cardsCacheCapacity', 100, 'number')); // MB
|
||||
// With 100 MB limit it would take roughly 3000 characters to reach this limit
|
||||
const characterDataCache = new MemoryLimitedMap(1024 * 1024 * cacheCapacity);
|
||||
// Some Android devices require tighter memory management
|
||||
|
@@ -19,9 +19,9 @@ import {
|
||||
formatBytes,
|
||||
} from '../util.js';
|
||||
|
||||
const isBackupEnabled = getConfigValue('backups.chat.enabled', true, 'boolean');
|
||||
const maxTotalChatBackups = getConfigValue('backups.chat.maxTotalBackups', -1, 'number');
|
||||
const throttleInterval = getConfigValue('backups.chat.throttleInterval', 10_000, 'number');
|
||||
const isBackupEnabled = !!getConfigValue('backups.chat.enabled', true, 'boolean');
|
||||
const maxTotalChatBackups = Number(getConfigValue('backups.chat.maxTotalBackups', -1, 'number'));
|
||||
const throttleInterval = Number(getConfigValue('backups.chat.throttleInterval', 10_000, 'number'));
|
||||
|
||||
/**
|
||||
* Saves a chat to the backups directory.
|
||||
|
@@ -11,9 +11,9 @@ import { jsonParser } from '../express-common.js';
|
||||
import { getAllUserHandles, getUserDirectories } from '../users.js';
|
||||
import { getFileNameValidationFunction } from '../middleware/validateFileName.js';
|
||||
|
||||
const ENABLE_EXTENSIONS = getConfigValue('extensions.enabled', true, 'boolean');
|
||||
const ENABLE_EXTENSIONS_AUTO_UPDATE = getConfigValue('extensions.autoUpdate', true, 'boolean');
|
||||
const ENABLE_ACCOUNTS = getConfigValue('enableUserAccounts', false, 'boolean');
|
||||
const ENABLE_EXTENSIONS = !!getConfigValue('extensions.enabled', true, 'boolean');
|
||||
const ENABLE_EXTENSIONS_AUTO_UPDATE = !!getConfigValue('extensions.autoUpdate', true, 'boolean');
|
||||
const ENABLE_ACCOUNTS = !!getConfigValue('enableUserAccounts', false, 'boolean');
|
||||
|
||||
// 10 minutes
|
||||
const AUTOSAVE_INTERVAL = 10 * 60 * 1000;
|
||||
|
@@ -7,8 +7,8 @@ import { default as git, CheckRepoActions } from 'simple-git';
|
||||
import { sync as commandExistsSync } from 'command-exists';
|
||||
import { getConfigValue, color } from './util.js';
|
||||
|
||||
const enableServerPlugins = getConfigValue('enableServerPlugins', false, 'boolean');
|
||||
const enableServerPluginsAutoUpdate = getConfigValue('enableServerPluginsAutoUpdate', true, 'boolean');
|
||||
const enableServerPlugins = !!getConfigValue('enableServerPlugins', false, 'boolean');
|
||||
const enableServerPluginsAutoUpdate = !!getConfigValue('enableServerPluginsAutoUpdate', true, 'boolean');
|
||||
|
||||
/**
|
||||
* Map of loaded plugins.
|
||||
|
Reference in New Issue
Block a user