diff --git a/lib/language-inference-engine.js b/lib/language-inference-engine.js index 0d84066..b8c72cd 100644 --- a/lib/language-inference-engine.js +++ b/lib/language-inference-engine.js @@ -303,6 +303,41 @@ var ENGINE_PROFILES = { return response.choices.reduce(function(a, x) { a.push(x.message.content); + return a; + }, []); + } + } + }, + "catswords": { + "type": "llm", + "defaultModel": "openchat-3.5-0106", + "headers": { + "Content-Type": "application/json", + "Authorization": "Bearer {apikey}" + }, + "url": "https://welsonjs-llm.catswords.net", + "wrap": function(model, message, temperature) { + "model": model, + "messages": [ + { + "role": "system", + "content": BIAS_MESSAGE + }, + { + "role": "user", + "content": message + } + ], + "temperature": temperature, + "stream": false + }, + "callback": function(response) { + if ("error" in response) { + return ["Error: " + response.error.message]; + } else { + return response.choices.reduce(function(a, x) { + a.push(x.message.content); + return a; }, []); }