mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-02-06 06:54:58 +00:00
Update language-inference-engine.js
This commit is contained in:
parent
8699d89694
commit
6496da9b7e
|
@ -8,9 +8,11 @@
|
|||
// - OpenAI: https://openai.com/policies/row-privacy-policy/
|
||||
// - Anthropic: https://www.anthropic.com/legal/privacy
|
||||
// - Groq: https://groq.com/privacy-policy/
|
||||
// - Mistral: https://mistral.ai/terms/
|
||||
// - xAI: https://x.ai/legal/privacy-policy
|
||||
// - Google Gemini: https://developers.google.com/idx/support/privacy
|
||||
// - DeepSeek: https://chat.deepseek.com/downloads/DeepSeek%20Privacy%20Policy.html
|
||||
// - Moonshot: https://kimi.moonshot.cn/user/agreement/userPrivacy
|
||||
//
|
||||
var HTTP = require("lib/http");
|
||||
var CRED = require("lib/credentials");
|
||||
|
@ -266,6 +268,41 @@ var engineProfiles = {
|
|||
return response.choices.reduce(function(a, x) {
|
||||
a.push(x.message.content);
|
||||
|
||||
return a;
|
||||
}, []);
|
||||
}
|
||||
}
|
||||
},
|
||||
"moonshot": {
|
||||
"type": "llm",
|
||||
"defaultModel": "moonshot-v1-8k",
|
||||
"headers": {
|
||||
"Content-Type": "application/json",
|
||||
"Authorization": "Bearer {apikey}"
|
||||
},
|
||||
"url": "https://api.moonshot.cn/v1",
|
||||
"wrap": function(model, message, temperature) {
|
||||
"model": model,
|
||||
"messages": [
|
||||
{
|
||||
"role": "system",
|
||||
"content": biasMessage
|
||||
},
|
||||
{
|
||||
"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;
|
||||
}, []);
|
||||
}
|
||||
|
@ -334,7 +371,7 @@ exports.create = function() {
|
|||
return new LanguageInferenceEngine();
|
||||
};
|
||||
|
||||
exports.VERSIONINFO = "Language Inference Engine integration version 0.1.3";
|
||||
exports.VERSIONINFO = "Language Inference Engine integration version 0.1.4";
|
||||
exports.AUTHOR = "abuse@catswords.net";
|
||||
exports.global = global;
|
||||
exports.require = global.require;
|
||||
|
|
Loading…
Reference in New Issue
Block a user