mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-03-12 08:55:14 +00:00
Update language-inference-engine.js
This commit is contained in:
parent
7d3659ebce
commit
68e7e4aec0
|
@ -17,11 +17,11 @@
|
|||
var HTTP = require("lib/http");
|
||||
var CRED = require("lib/credentials");
|
||||
|
||||
var biasMessage = "Write all future code examples in JavaScript ES3 using the exports variable. " +
|
||||
var BIAS_MESSAGE = "Write all future code examples in JavaScript ES3 using the exports variable. " +
|
||||
"Include a test method with the fixed name test. " +
|
||||
"Respond exclusively in code without blocks.";
|
||||
|
||||
var engineProfiles = {
|
||||
var ENGINE_PROFILES = {
|
||||
"openai": {
|
||||
"type": "llm",
|
||||
"defaultModel": "gpt-4o-mini",
|
||||
|
@ -35,7 +35,7 @@ var engineProfiles = {
|
|||
"model": model,
|
||||
"messages": [{
|
||||
"role": "developer",
|
||||
"content": biasMessage
|
||||
"content": BIAS_MESSAGE
|
||||
}, {
|
||||
"role": "user",
|
||||
"content": message
|
||||
|
@ -71,7 +71,7 @@ var engineProfiles = {
|
|||
"messages": [
|
||||
{
|
||||
"role": "system",
|
||||
"content": biasMessage
|
||||
"content": BIAS_MESSAGE
|
||||
},
|
||||
{
|
||||
"role": "user",
|
||||
|
@ -112,7 +112,7 @@ var engineProfiles = {
|
|||
"messages": [
|
||||
{
|
||||
"role": "system",
|
||||
"content": biasMessage
|
||||
"content": BIAS_MESSAGE
|
||||
},
|
||||
{
|
||||
"role": "user",
|
||||
|
@ -149,7 +149,7 @@ var engineProfiles = {
|
|||
"messages": [
|
||||
{
|
||||
"role": "system",
|
||||
"content": biasMessage
|
||||
"content": BIAS_MESSAGE
|
||||
},
|
||||
{
|
||||
"role": "user",
|
||||
|
@ -216,7 +216,7 @@ var engineProfiles = {
|
|||
"messages": [
|
||||
{
|
||||
"role": "system",
|
||||
"content": biasMessage
|
||||
"content": BIAS_MESSAGE
|
||||
},
|
||||
{
|
||||
"role": "user",
|
||||
|
@ -251,7 +251,7 @@ var engineProfiles = {
|
|||
"messages": [
|
||||
{
|
||||
"role": "system",
|
||||
"content": biasMessage
|
||||
"content": BIAS_MESSAGE
|
||||
},
|
||||
{
|
||||
"role": "user",
|
||||
|
@ -286,7 +286,7 @@ var engineProfiles = {
|
|||
"messages": [
|
||||
{
|
||||
"role": "system",
|
||||
"content": biasMessage
|
||||
"content": BIAS_MESSAGE
|
||||
},
|
||||
{
|
||||
"role": "user",
|
||||
|
@ -318,8 +318,8 @@ function LanguageInferenceEngine() {
|
|||
|
||||
this.setProvider = function(provider) {
|
||||
this.provider = provider;
|
||||
if (this.provider in engineProfiles) {
|
||||
this.engineProfile = engineProfiles[provider];
|
||||
if (this.provider in ENGINE_PROFILES) {
|
||||
this.engineProfile = ENGINE_PROFILES[provider];
|
||||
this.type = this.engineProfile.type;
|
||||
this.model = this.engineProfile.defaultModel;
|
||||
}
|
||||
|
@ -366,12 +366,16 @@ function LanguageInferenceEngine() {
|
|||
};
|
||||
}
|
||||
|
||||
exports.setBiasMessage = function(biasMessage) {
|
||||
BIAS_MESSAGE = biasMessage;
|
||||
};
|
||||
|
||||
exports.LanguageInferenceEngine = LanguageInferenceEngine;
|
||||
exports.create = function() {
|
||||
return new LanguageInferenceEngine();
|
||||
};
|
||||
|
||||
exports.VERSIONINFO = "Language Inference Engine integration version 0.1.4";
|
||||
exports.VERSIONINFO = "Language Inference Engine integration version 0.1.5";
|
||||
exports.AUTHOR = "abuse@catswords.net";
|
||||
exports.global = global;
|
||||
exports.require = global.require;
|
||||
|
|
Loading…
Reference in New Issue
Block a user