Update language-inference-engine.js

This commit is contained in:
Namhyeon Go 2025-01-28 09:46:45 +09:00
parent 47bb893c49
commit fe5542a521

View File

@ -21,6 +21,7 @@ var biasMessage = "Write all future code examples in JavaScript ES3 using the ex
var engineProfiles = {
"openai": {
"type": "llm",
"defaultModel": "gpt-4o-mini",
"headers": {
"Content-Type": "application/json",
@ -53,6 +54,7 @@ var engineProfiles = {
}
},
"anthropic": {
"type": "llm",
"defaultModel": "claude-3-5-sonnet-20241022",
"headers": {
"Content-Type": "application/json",
@ -94,6 +96,7 @@ var engineProfiles = {
}
},
"groq": {
"type": "llm",
"defaultModel": "llama-3.1-8b-instant",
"headers": {
"Content-Type": "application/json",
@ -129,6 +132,7 @@ var engineProfiles = {
}
},
"xai": {
"type": "llm",
"defaultModel": "grok-2-latest",
"headers": {
"Content-Type": "application/json",
@ -160,6 +164,7 @@ var engineProfiles = {
}
},
"google": {
"type": "llm",
"defaultModel": "gemini-1.5-flash",
"headers": {
"Content-Type": "application/json",
@ -198,6 +203,7 @@ var engineProfiles = {
}
},
"deepseek": {
"type": "llm",
"defaultModel": "deepseek-chat",
"headers": {
"Content-Type": "application/json",
@ -234,16 +240,16 @@ var engineProfiles = {
};
function LanguageInferenceEngine() {
this.type = "llm"; // e.g. legacy (Legacy NLP), llm (LLM)
this.type = ""; // e.g. legacy (Legacy NLP), llm (LLM)
this.provider = "";
this.model = "";
this.engineProfile = null;
this.setProvider = function(provider) {
this.provider = provider;
if (provider in engineProfiles) {
if (this.provider in engineProfiles) {
this.engineProfile = engineProfiles[provider];
this.type = this.engineProfile.type;
this.model = this.engineProfile.defaultModel;
}