Add config value type converters for numbers and booleans

This commit is contained in:
Cohee
2025-02-20 21:53:48 +02:00
parent 7571552fef
commit 3f03936125
18 changed files with 88 additions and 53 deletions

View File

@@ -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);
const numBatch = getConfigValue('ollama.batchSize', -1);
const keepAlive = getConfigValue('ollama.keepAlive', -1, 'number');
const numBatch = getConfigValue('ollama.batchSize', -1, 'number');
if (numBatch > 0) {
request.body['num_batch'] = numBatch;
}