ai返回接口

This commit is contained in:
Jerry 2025-04-25 13:56:05 +08:00
parent 8805c60e98
commit 45592a1852
6 changed files with 61 additions and 4 deletions

29
constants/ai/aiModels.js Normal file
View File

@ -0,0 +1,29 @@
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;

View File

View File

@ -0,0 +1,28 @@
// 规范ai返回形式
const returnMessages = [
{
type: 'message',
data: 'Hello, this is a text message.',
},
{
type: 'image',
data: 'test',
},
{
type: 'at',
data: 114514,
},
{
type: 'function',
data: '1',
extra: {
params: {
1: '1',
2: '2',
},
callAI: true,
},
},
];
export default returnMessages;

View File

@ -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/path.js'; import Path from './constants/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';

View File

@ -1,8 +1,8 @@
import Path, { defaultConfig } from '../../constants/path/path.js'; import Path, { defaultConfig } from '../../constants/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/path/relativelyPath.js'; import relativelyPath from '../../constants/relativelyPath.js';
const configPath = Path.config; const configPath = Path.config;
const configFile = path.join(configPath, 'config.json'); const configFile = path.join(configPath, 'config.json');

View File

@ -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/path.js'; import Path from '../../constants/path.js';
const GIT_DIR = path.join(Path.root, '.git'); const GIT_DIR = path.join(Path.root, '.git');