Update language-inference-engine.js

This commit is contained in:
Namhyeon Go 2025-01-30 18:59:04 +09:00
parent 4c8a127ad3
commit 60a26b3ad0

View File

@ -24,7 +24,9 @@ var BIAS_MESSAGE = "Write all future code examples in JavaScript ES3 using the e
var ENGINE_PROFILES = { var ENGINE_PROFILES = {
"openai": { "openai": {
"type": "llm", "type": "llm",
"defaultModel": "gpt-4o-mini", "availableModels": [
"gpt-4o-mini"
],
"headers": { "headers": {
"Content-Type": "application/json", "Content-Type": "application/json",
"Authorization": "Bearer {apikey}" "Authorization": "Bearer {apikey}"
@ -58,7 +60,9 @@ var ENGINE_PROFILES = {
}, },
"anthropic": { "anthropic": {
"type": "llm", "type": "llm",
"defaultModel": "claude-3-5-sonnet-20241022", "availableModels": [
"claude-3-5-sonnet-20241022"
],
"headers": { "headers": {
"Content-Type": "application/json", "Content-Type": "application/json",
"x-api-key": "{apikey}", "x-api-key": "{apikey}",
@ -100,7 +104,9 @@ var ENGINE_PROFILES = {
}, },
"groq": { "groq": {
"type": "llm", "type": "llm",
"defaultModel": "llama-3.1-8b-instant", "availableModels": [
"llama-3.1-8b-instant"
],
"headers": { "headers": {
"Content-Type": "application/json", "Content-Type": "application/json",
"Authorization": "Bearer {apikey}" "Authorization": "Bearer {apikey}"
@ -137,7 +143,9 @@ var ENGINE_PROFILES = {
}, },
"xai": { "xai": {
"type": "llm", "type": "llm",
"defaultModel": "grok-2-latest", "availableModels": [
"grok-2-latest"
],
"headers": { "headers": {
"Content-Type": "application/json", "Content-Type": "application/json",
"Authorization": "Bearer {apikey}" "Authorization": "Bearer {apikey}"
@ -170,7 +178,9 @@ var ENGINE_PROFILES = {
}, },
"google": { "google": {
"type": "llm", "type": "llm",
"defaultModel": "gemini-1.5-flash", "availableModels": [
"gemini-1.5-flash"
],
"headers": { "headers": {
"Content-Type": "application/json", "Content-Type": "application/json",
"Authorization": "Bearer {apikey}" "Authorization": "Bearer {apikey}"
@ -209,7 +219,9 @@ var ENGINE_PROFILES = {
}, },
"mistral": { "mistral": {
"type": "llm", "type": "llm",
"defaultModel": "ministral-8b-latest", "availableModels": [
"ministral-8b-latest"
],
"url": "https://api.mistral.ai/v1/chat/completions", "url": "https://api.mistral.ai/v1/chat/completions",
"wrap": function(model, message, temperature) { "wrap": function(model, message, temperature) {
"model": model, "model": model,
@ -240,7 +252,9 @@ var ENGINE_PROFILES = {
}, },
"deepseek": { "deepseek": {
"type": "llm", "type": "llm",
"defaultModel": "deepseek-chat", "availableModels": [
"deepseek-chat"
],
"headers": { "headers": {
"Content-Type": "application/json", "Content-Type": "application/json",
"Authorization": "Bearer {apikey}" "Authorization": "Bearer {apikey}"
@ -275,7 +289,9 @@ var ENGINE_PROFILES = {
}, },
"moonshot": { "moonshot": {
"type": "llm", "type": "llm",
"defaultModel": "moonshot-v1-8k", "availableModels": [
"moonshot-v1-8k"
],
"headers": { "headers": {
"Content-Type": "application/json", "Content-Type": "application/json",
"Authorization": "Bearer {apikey}" "Authorization": "Bearer {apikey}"
@ -310,7 +326,11 @@ var ENGINE_PROFILES = {
}, },
"catswords": { "catswords": {
"type": "llm", "type": "llm",
"defaultModel": "openchat-3.5-0106", "availableModels": [
"openchat-3.5-0106",
"qwen1.5-14b-chat-awq",
"gemma-7b-it"
],
"headers": { "headers": {
"Content-Type": "application/json", "Content-Type": "application/json",
"Authorization": "Bearer {apikey}" "Authorization": "Bearer {apikey}"
@ -356,7 +376,7 @@ function LanguageInferenceEngine() {
if (this.provider in ENGINE_PROFILES) { if (this.provider in ENGINE_PROFILES) {
this.engineProfile = ENGINE_PROFILES[provider]; this.engineProfile = ENGINE_PROFILES[provider];
this.type = this.engineProfile.type; this.type = this.engineProfile.type;
this.model = this.engineProfile.defaultModel; this.model = this.engineProfile.availableModels[0];
} }
return this; return this;
@ -410,7 +430,7 @@ exports.create = function() {
return new LanguageInferenceEngine(); return new LanguageInferenceEngine();
}; };
exports.VERSIONINFO = "Language Inference Engine integration version 0.1.5"; exports.VERSIONINFO = "Language Inference Engine integration version 0.1.6";
exports.AUTHOR = "abuse@catswords.net"; exports.AUTHOR = "abuse@catswords.net";
exports.global = global; exports.global = global;
exports.require = global.require; exports.require = global.require;