Implement Key Filter

This commit is contained in:
NWilson 2024-02-20 09:40:35 -06:00
parent 48b9eb8542
commit 7c12c836f2
1 changed files with 5 additions and 0 deletions

View File

@ -263,6 +263,11 @@ router.post('/generate', jsonParser, async function (request, response) {
args.body = JSON.stringify(request.body); args.body = JSON.stringify(request.body);
} }
if (request.body.api_type === TEXTGEN_TYPES.INFERMATICAI) {
request.body = _.pickBy(request.body, (_, key) => INFERMATICAI_KEYS.includes(key));
args.body = JSON.stringify(request.body);
}
if (request.body.api_type === TEXTGEN_TYPES.OLLAMA) { if (request.body.api_type === TEXTGEN_TYPES.OLLAMA) {
args.body = JSON.stringify({ args.body = JSON.stringify({
model: request.body.model, model: request.body.model,