Skip to content

feat:ai add deepseek #28

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion app/lib/enum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -290,5 +290,6 @@ export enum E_FOUNDATION_MODEL {
GPT_35_TURBO = 'gpt-3.5-turbo', // openai
Local_GPT = 'local-compatible-gpt-3.5', //本地兼容opanai-api接口的 大语言模型,如chatGLM6b,通义千问 等。
ERNIE_BOT_TURBO = 'ERNIE-4.0-8K', // 文心一言
MOONSHOT_V1_8K = 'moonshot-v1-8k' // kimi
MOONSHOT_V1_8K = 'moonshot-v1-8k', // kimi
DEEPSEEK_CHAT = 'deepseek-chat' // DeepSeek-V3
}
38 changes: 27 additions & 11 deletions config/config.default.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ export default (appInfo) => {
}
};

config.cors = {
origin: '*',
allowMethods: 'GET,HEAD,PUT,POST,DELETE,PATCH',
credentials: true
};

config.deploy = {
baseDir: path.resolve(appInfo.baseDir, './deploy'),
obsOrigin: process.env.obsAccessUrl,
Expand All @@ -63,7 +69,6 @@ export default (appInfo) => {

config.queueName = 'tinyengine.build.platform'; // 构建设计器 rabbitMq 队列名称


config.security = {
csrf: {
enable: false,
Expand Down Expand Up @@ -102,7 +107,6 @@ export default (appInfo) => {
}
};


config.proxy = true;

// 消息队列配置,请配置自己的服务或者删除该配置及相关代码, 本代码仅供连接 rabbitMQ 参考
Expand Down Expand Up @@ -277,7 +281,9 @@ export default (appInfo) => {
manufacturer: '!openai'
},
[E_FOUNDATION_MODEL.ERNIE_BOT_TURBO]: {
httpRequestUrl: `https://aip.baidubce.com/rpc/2.0/ai_custom/v1/wenxinworkshop/chat/completions_pro?access_token=${token || process.env.WENXIN_ACCESS_TOKEN}`,
httpRequestUrl: `https://aip.baidubce.com/rpc/2.0/ai_custom/v1/wenxinworkshop/chat/completions_pro?access_token=${
token || process.env.WENXIN_ACCESS_TOKEN
}`,
httpRequestOption: {
...commonRequestOption,
data: {
Expand All @@ -287,6 +293,20 @@ export default (appInfo) => {
},
manufacturer: 'baidu'
},
[E_FOUNDATION_MODEL.DEEPSEEK_CHAT]: {
httpRequestUrl: `https://api.deepseek.com/chat/completions`,
httpRequestOption: {
...commonRequestOption,
data: {
model: E_FOUNDATION_MODEL.DEEPSEEK_CHAT,
messages
},
headers: {
Authorization: `Bearer ${token}`
}
},
manufacturer: 'deepseek'
},
[E_FOUNDATION_MODEL.MOONSHOT_V1_8K]: {
httpRequestUrl: `https://api.moonshot.cn/v1/chat/completions`,
httpRequestOption: {
Expand Down Expand Up @@ -337,19 +357,15 @@ export default (appInfo) => {
};
};

config.npmRegistryOptions = [
'--registry=https://registry.npmjs.org/'
];
config.npmRegistryOptions = ['--registry=https://registry.npmjs.org/'];
// 国内镜像
config.cnpmRegistryOptions = [
'--registry=http://registry.npmmirror.com/'
];
config.cnpmRegistryOptions = ['--registry=http://registry.npmmirror.com/'];
config.buildground = '/tmp/buildground';
config.baseNpm = '@opentiny/tiny-engine-block-build';
config.authToken = process.env.NPM_AUTH_TOKEN; // 替换为自己的npm token
config.registry = 'https://registry.npmjs.org/'; // 如果部署了私仓可替换为自己私仓地址
config.projectName = process.env.GIT_REPO; // 应用发布git仓库地址
config.gitBranch = process.env.GIT_BRANCH; // 应用发布git代码默认提交分支
config.projectName = process.env.GIT_REPO; // 应用发布git仓库地址
config.gitBranch = process.env.GIT_BRANCH; // 应用发布git代码默认提交分支
config.userName = process.env.GIT_USERNAME;
config.userToken = process.env.GIT_USER_TOKEN;
config.email = process.env.GIT_EMAIL;
Expand Down
Loading