mirror of
https://github.com/Jerryplusy/crystelf-plugin.git
synced 2025-07-04 14:19:19 +00:00
ai返回接口
This commit is contained in:
parent
0fe327b0d7
commit
8805c60e98
@ -1,29 +0,0 @@
|
|||||||
const aiModels = {
|
|
||||||
openai: {
|
|
||||||
gpt3: 'text-davinci-003',
|
|
||||||
gpt4: 'gpt-4',
|
|
||||||
gpt35_turbo: 'gpt-3.5-turbo',
|
|
||||||
},
|
|
||||||
|
|
||||||
deepseek: {
|
|
||||||
r1: 'deepseek-ai/DeepSeek-R1',
|
|
||||||
v3: 'deepseek-ai/DeepSeek-V3',
|
|
||||||
r1_distill_Qwen_32b: 'deepseek-ai/DeepSeek-R1-Distill-Qwen-32B', //1.26
|
|
||||||
r1_distill_Qwen_14b: 'deepseek-ai/DeepSeek-R1-Distill-Qwen-14B', //0.7
|
|
||||||
},
|
|
||||||
|
|
||||||
THUDM: {
|
|
||||||
GLM4_32b: 'THUDM/GLM-4-32B-0414', // 1.89 tokens
|
|
||||||
GLMZ1_32b: 'THUDM/GLM-Z1-32B-0414', // 4 tokens
|
|
||||||
GLM4_9b: 'THUDM/GLM-4-9B-0414', //free
|
|
||||||
},
|
|
||||||
|
|
||||||
Qwen: {
|
|
||||||
Qwen25VL_32b: 'Qwen/Qwen2.5-VL-32B-Instruct', // 4.13 视觉
|
|
||||||
QwenQ_32b: 'Qwen/QwQ-32B', //4/M tokens
|
|
||||||
Qwen25_72b: 'Qwen/Qwen2.5-72B-Instruct-128K', //4.13
|
|
||||||
QwenQVQ_72b_preview: 'Qwen/QVQ-72B-Preview', //9.9 视觉
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
export default aiModels;
|
|
@ -1,26 +0,0 @@
|
|||||||
import path from 'path';
|
|
||||||
import url from 'url';
|
|
||||||
import fs from 'fs';
|
|
||||||
|
|
||||||
const __filename = url.fileURLToPath(import.meta.url);
|
|
||||||
const __dirname = path.dirname(__filename);
|
|
||||||
const rootDir = path.join(__dirname, '..');
|
|
||||||
|
|
||||||
const Path = {
|
|
||||||
root: rootDir,
|
|
||||||
apps: path.join(rootDir, 'apps'),
|
|
||||||
components: path.join(rootDir, 'components'),
|
|
||||||
defaultConfig: path.join(rootDir, 'config/default.json'),
|
|
||||||
config: path.resolve(rootDir, '../../data/crystelf'),
|
|
||||||
constants: path.join(rootDir, 'constants'),
|
|
||||||
lib: path.join(rootDir, 'lib'),
|
|
||||||
models: path.join(rootDir, 'models'),
|
|
||||||
index: path.join(rootDir, 'index.js'),
|
|
||||||
pkg: path.join(rootDir, 'package.json'),
|
|
||||||
yunzai: path.join(rootDir, '../../'),
|
|
||||||
};
|
|
||||||
|
|
||||||
const configFile = fs.readFileSync(Path.defaultConfig, 'utf8');
|
|
||||||
export const defaultConfig = JSON.parse(configFile);
|
|
||||||
|
|
||||||
export default Path;
|
|
@ -1,5 +0,0 @@
|
|||||||
const relativelyPath = {
|
|
||||||
config: '/data/crystelf/config.json',
|
|
||||||
};
|
|
||||||
|
|
||||||
export default relativelyPath;
|
|
2
index.js
2
index.js
@ -1,7 +1,7 @@
|
|||||||
import chalk from 'chalk';
|
import chalk from 'chalk';
|
||||||
import Version from './lib/system/version.js';
|
import Version from './lib/system/version.js';
|
||||||
import fc from './components/json.js';
|
import fc from './components/json.js';
|
||||||
import Path from './constants/path.js';
|
import Path from './constants/path/path.js';
|
||||||
import { crystelfInit } from './lib/system/init.js';
|
import { crystelfInit } from './lib/system/init.js';
|
||||||
import updater from './lib/system/updater.js';
|
import updater from './lib/system/updater.js';
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import Path, { defaultConfig } from '../../constants/path.js';
|
import Path, { defaultConfig } from '../../constants/path/path.js';
|
||||||
import fc from '../../components/json.js';
|
import fc from '../../components/json.js';
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
import relativelyPath from '../../constants/relativelyPath.js';
|
import relativelyPath from '../../constants/path/relativelyPath.js';
|
||||||
|
|
||||||
const configPath = Path.config;
|
const configPath = Path.config;
|
||||||
const configFile = path.join(configPath, 'config.json');
|
const configFile = path.join(configPath, 'config.json');
|
||||||
|
@ -2,7 +2,7 @@ import child_process from 'child_process';
|
|||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
import chalk from 'chalk';
|
import chalk from 'chalk';
|
||||||
import Path from '../../constants/path.js';
|
import Path from '../../constants/path/path.js';
|
||||||
|
|
||||||
const GIT_DIR = path.join(Path.root, '.git');
|
const GIT_DIR = path.join(Path.root, '.git');
|
||||||
|
|
||||||
@ -31,8 +31,11 @@ const Updater = {
|
|||||||
|
|
||||||
await new Promise((resolve, reject) => {
|
await new Promise((resolve, reject) => {
|
||||||
child_process.exec('git fetch', { cwd: Path.root }, (err) => {
|
child_process.exec('git fetch', { cwd: Path.root }, (err) => {
|
||||||
if (err) reject(err);
|
if (err) {
|
||||||
else resolve();
|
reject(err);
|
||||||
|
} else {
|
||||||
|
resolve();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -48,7 +51,10 @@ const Updater = {
|
|||||||
|
|
||||||
async update() {
|
async update() {
|
||||||
logger.mark(chalk.cyan('[crystelf-plugin] 检测到插件有更新,自动执行 git pull'));
|
logger.mark(chalk.cyan('[crystelf-plugin] 检测到插件有更新,自动执行 git pull'));
|
||||||
child_process.execSync('git pull', { cwd: Path.root, stdio: 'inherit' });
|
child_process.execSync('git pull', {
|
||||||
|
cwd: Path.root,
|
||||||
|
stdio: 'inherit',
|
||||||
|
});
|
||||||
logger.mark(chalk.green('[crystelf-plugin] 插件已自动更新完成'));
|
logger.mark(chalk.green('[crystelf-plugin] 插件已自动更新完成'));
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user