From 7c12c836f21880fc1178508c965a6b78660516b2 Mon Sep 17 00:00:00 2001 From: NWilson Date: Tue, 20 Feb 2024 09:40:35 -0600 Subject: [PATCH] Implement Key Filter --- src/endpoints/backends/text-completions.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/endpoints/backends/text-completions.js b/src/endpoints/backends/text-completions.js index ddd30fbb0..443e743aa 100644 --- a/src/endpoints/backends/text-completions.js +++ b/src/endpoints/backends/text-completions.js @@ -263,6 +263,11 @@ router.post('/generate', jsonParser, async function (request, response) { 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) { args.body = JSON.stringify({ model: request.body.model,