This commit is contained in:
di-sukharev
2023-07-05 14:57:03 +08:00
parent 18d25672d7
commit e7ce40a8d1
2 changed files with 492 additions and 452 deletions
+472 -446
View File
File diff suppressed because it is too large Load Diff
+20 -6
View File
@@ -27411,10 +27411,10 @@ function G3(t, e2) {
} }
// src/commands/config.ts // src/commands/config.ts
var import_path = require("path");
var import_ini = __toESM(require_ini(), 1);
var import_fs = require("fs"); var import_fs = require("fs");
var import_ini = __toESM(require_ini(), 1);
var import_os = require("os"); var import_os = require("os");
var import_path = require("path");
// src/i18n/en.json // src/i18n/en.json
var en_default = { var en_default = {
@@ -27699,8 +27699,21 @@ var configValidators = {
["OCO_MODEL" /* OCO_MODEL */](value) { ["OCO_MODEL" /* OCO_MODEL */](value) {
validateConfig( validateConfig(
"OCO_MODEL" /* OCO_MODEL */, "OCO_MODEL" /* OCO_MODEL */,
["gpt-3.5-turbo", "gpt-4"].includes(value), [
`${value} is not supported yet, use 'gpt-4' or 'gpt-3.5-turbo' (default)` "gpt-3.5-turbo",
"gpt-4",
"gpt-3.5-turbo-16k",
"gpt-3.5-turbo-0613"
].includes(value),
`${value} is not supported yet, use 'gpt-4', 'gpt-3.5-turbo-0613', 'gpt-3.5-turbo-0613' or 'gpt-3.5-turbo' (default)`
);
return value;
},
["OCO_MESSAGE_TEMPLATE_PLACEHOLDER" /* OCO_MESSAGE_TEMPLATE_PLACEHOLDER */](value) {
validateConfig(
"OCO_MESSAGE_TEMPLATE_PLACEHOLDER" /* OCO_MESSAGE_TEMPLATE_PLACEHOLDER */,
value.startsWith("$"),
`${value} must start with $, for example: '$msg'`
); );
return value; return value;
} }
@@ -27713,8 +27726,9 @@ var getConfig = () => {
OCO_OPENAI_BASE_PATH: process.env.OCO_OPENAI_BASE_PATH, OCO_OPENAI_BASE_PATH: process.env.OCO_OPENAI_BASE_PATH,
OCO_DESCRIPTION: process.env.OCO_DESCRIPTION === "true" ? true : false, OCO_DESCRIPTION: process.env.OCO_DESCRIPTION === "true" ? true : false,
OCO_EMOJI: process.env.OCO_EMOJI === "true" ? true : false, OCO_EMOJI: process.env.OCO_EMOJI === "true" ? true : false,
OCO_MODEL: process.env.OCO_MODEL || "gpt-3.5-turbo", OCO_MODEL: process.env.OCO_MODEL || "gpt-3.5-turbo-16k",
OCO_LANGUAGE: process.env.OCO_LANGUAGE || "en" OCO_LANGUAGE: process.env.OCO_LANGUAGE || "en",
OCO_MESSAGE_TEMPLATE_PLACEHOLDER: process.env.OCO_MESSAGE_TEMPLATE_PLACEHOLDER || "$msg"
}; };
const configExists = (0, import_fs.existsSync)(configPath); const configExists = (0, import_fs.existsSync)(configPath);
if (!configExists) if (!configExists)