Update LIE(Language Inference Engine) integraton of the app.js
Some checks failed
CodeQL / Analyze (csharp) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled

This commit is contained in:
Namhyeon Go 2025-01-28 09:53:55 +09:00
parent fe5542a521
commit fb947cc777
2 changed files with 7 additions and 3 deletions

9
app.js
View File

@ -230,12 +230,17 @@ function require(pathname) {
}); });
} }
// load script from ChatGPT (LLM based AI) service // load script from LIE(Language Inference Engine) service
if (["ai"].indexOf(scheme) > -1) { if (["ai"].indexOf(scheme) > -1) {
require._addScriptProvider(function(url) { require._addScriptProvider(function(url) {
try { try {
var text = url.substring(pos + sep.length); var text = url.substring(pos + sep.length);
return require("lib/chatgpt").chat(text); return require("lib/language-inference-engine")
.create()
.setProvider("openai")
.inference(text, 0)
.join(' ')
;
} catch (e) { } catch (e) {
return null; return null;
} }

View File

@ -65,7 +65,6 @@ var engineProfiles = {
"wrap": function(model, message, temperature) { "wrap": function(model, message, temperature) {
return { return {
"model": model, "model": model,
"max_tokens": 1024,
"messages": [ "messages": [
{ {
"role": "system", "role": "system",