mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-02-06 15:04:58 +00:00
Update language-inference-engine.js
This commit is contained in:
parent
47bb893c49
commit
fe5542a521
|
@ -21,6 +21,7 @@ var biasMessage = "Write all future code examples in JavaScript ES3 using the ex
|
||||||
|
|
||||||
var engineProfiles = {
|
var engineProfiles = {
|
||||||
"openai": {
|
"openai": {
|
||||||
|
"type": "llm",
|
||||||
"defaultModel": "gpt-4o-mini",
|
"defaultModel": "gpt-4o-mini",
|
||||||
"headers": {
|
"headers": {
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
|
@ -53,6 +54,7 @@ var engineProfiles = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"anthropic": {
|
"anthropic": {
|
||||||
|
"type": "llm",
|
||||||
"defaultModel": "claude-3-5-sonnet-20241022",
|
"defaultModel": "claude-3-5-sonnet-20241022",
|
||||||
"headers": {
|
"headers": {
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
|
@ -94,6 +96,7 @@ var engineProfiles = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"groq": {
|
"groq": {
|
||||||
|
"type": "llm",
|
||||||
"defaultModel": "llama-3.1-8b-instant",
|
"defaultModel": "llama-3.1-8b-instant",
|
||||||
"headers": {
|
"headers": {
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
|
@ -129,6 +132,7 @@ var engineProfiles = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"xai": {
|
"xai": {
|
||||||
|
"type": "llm",
|
||||||
"defaultModel": "grok-2-latest",
|
"defaultModel": "grok-2-latest",
|
||||||
"headers": {
|
"headers": {
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
|
@ -160,6 +164,7 @@ var engineProfiles = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"google": {
|
"google": {
|
||||||
|
"type": "llm",
|
||||||
"defaultModel": "gemini-1.5-flash",
|
"defaultModel": "gemini-1.5-flash",
|
||||||
"headers": {
|
"headers": {
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
|
@ -198,6 +203,7 @@ var engineProfiles = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"deepseek": {
|
"deepseek": {
|
||||||
|
"type": "llm",
|
||||||
"defaultModel": "deepseek-chat",
|
"defaultModel": "deepseek-chat",
|
||||||
"headers": {
|
"headers": {
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
|
@ -234,16 +240,16 @@ var engineProfiles = {
|
||||||
};
|
};
|
||||||
|
|
||||||
function LanguageInferenceEngine() {
|
function LanguageInferenceEngine() {
|
||||||
this.type = "llm"; // e.g. legacy (Legacy NLP), llm (LLM)
|
this.type = ""; // e.g. legacy (Legacy NLP), llm (LLM)
|
||||||
this.provider = "";
|
this.provider = "";
|
||||||
this.model = "";
|
this.model = "";
|
||||||
this.engineProfile = null;
|
this.engineProfile = null;
|
||||||
|
|
||||||
this.setProvider = function(provider) {
|
this.setProvider = function(provider) {
|
||||||
this.provider = provider;
|
this.provider = provider;
|
||||||
|
if (this.provider in engineProfiles) {
|
||||||
if (provider in engineProfiles) {
|
|
||||||
this.engineProfile = engineProfiles[provider];
|
this.engineProfile = engineProfiles[provider];
|
||||||
|
this.type = this.engineProfile.type;
|
||||||
this.model = this.engineProfile.defaultModel;
|
this.model = this.engineProfile.defaultModel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user