From f088ec357abd890a14970ee3a10141d0aae4b22d Mon Sep 17 00:00:00 2001 From: JackChiang <2091058971@qq.com> Date: Mon, 13 Apr 2026 11:33:30 +0800 Subject: [PATCH] add-qiniu-provider --- relay/adaptor/openai/compatible.go | 4 ++++ relay/adaptor/qiniu/constants.go | 7 +++++++ relay/channeltype/define.go | 1 + relay/channeltype/url.go | 1 + web/air/src/constants/channel.constants.js | 1 + web/air/src/pages/Channel/EditChannel.js | 3 +++ web/berry/src/constants/ChannelConstants.js | 6 ++++++ web/berry/src/views/Channel/type/Config.js | 6 ++++++ web/default/src/constants/channel.constants.js | 6 ++++++ 9 files changed, 35 insertions(+) create mode 100644 relay/adaptor/qiniu/constants.go diff --git a/relay/adaptor/openai/compatible.go b/relay/adaptor/openai/compatible.go index 955cb090c6..22e8eb9b8a 100644 --- a/relay/adaptor/openai/compatible.go +++ b/relay/adaptor/openai/compatible.go @@ -15,6 +15,7 @@ import ( "github.com/songquanpeng/one-api/relay/adaptor/moonshot" "github.com/songquanpeng/one-api/relay/adaptor/novita" "github.com/songquanpeng/one-api/relay/adaptor/openrouter" + "github.com/songquanpeng/one-api/relay/adaptor/qiniu" "github.com/songquanpeng/one-api/relay/adaptor/siliconflow" "github.com/songquanpeng/one-api/relay/adaptor/stepfun" "github.com/songquanpeng/one-api/relay/adaptor/togetherai" @@ -41,6 +42,7 @@ var CompatibleChannels = []int{ channeltype.XAI, channeltype.BaiduV2, channeltype.XunfeiV2, + channeltype.Qiniu, } func GetCompatibleChannelMeta(channelType int) (string, []string) { @@ -85,6 +87,8 @@ func GetCompatibleChannelMeta(channelType int) (string, []string) { return "alibailian", alibailian.ModelList case channeltype.GeminiOpenAICompatible: return "geminiv2", geminiv2.ModelList + case channeltype.Qiniu: + return "qiniu", qiniu.ModelList default: return "openai", ModelList } diff --git a/relay/adaptor/qiniu/constants.go b/relay/adaptor/qiniu/constants.go new file mode 100644 index 0000000000..3fbbc000c8 --- /dev/null +++ b/relay/adaptor/qiniu/constants.go @@ -0,0 +1,7 @@ +package qiniu + +// https://api.qnaigc.com OpenAI-compatible gateway; model names follow the console. + +var ModelList = []string{ + "deepseek-v3", +} diff --git a/relay/channeltype/define.go b/relay/channeltype/define.go index f557d6c687..4db0f9ba88 100644 --- a/relay/channeltype/define.go +++ b/relay/channeltype/define.go @@ -53,5 +53,6 @@ const ( AliBailian OpenAICompatible GeminiOpenAICompatible + Qiniu Dummy ) diff --git a/relay/channeltype/url.go b/relay/channeltype/url.go index 5a47a64e29..302343c98f 100644 --- a/relay/channeltype/url.go +++ b/relay/channeltype/url.go @@ -54,6 +54,7 @@ var ChannelBaseURLs = []string{ "", // 50 "https://generativelanguage.googleapis.com/v1beta/openai/", // 51 + "https://api.qnaigc.com", // 52 } func init() { diff --git a/web/air/src/constants/channel.constants.js b/web/air/src/constants/channel.constants.js index 00a1d52818..ee5e9fc509 100644 --- a/web/air/src/constants/channel.constants.js +++ b/web/air/src/constants/channel.constants.js @@ -32,6 +32,7 @@ export const CHANNEL_OPTIONS = [ { key: 44, text: 'SiliconFlow', value: 44, color: 'blue' }, { key: 45, text: 'xAI', value: 45, color: 'blue' }, { key: 46, text: 'Replicate', value: 46, color: 'blue' }, + { key: 52, text: '七牛云', value: 52, color: 'blue' }, { key: 8, text: '自定义渠道', value: 8, color: 'pink' }, { key: 22, text: '知识库:FastGPT', value: 22, color: 'blue' }, { key: 21, text: '知识库:AI Proxy', value: 21, color: 'purple' }, diff --git a/web/air/src/pages/Channel/EditChannel.js b/web/air/src/pages/Channel/EditChannel.js index 4a810830bd..b0b0d9c52d 100644 --- a/web/air/src/pages/Channel/EditChannel.js +++ b/web/air/src/pages/Channel/EditChannel.js @@ -118,6 +118,9 @@ const EditChannel = (props) => { 'mj_pan', ]; break; + case 52: + localModels = ['deepseek-v3']; + break; } setInputs((inputs) => ({...inputs, models: localModels})); } diff --git a/web/berry/src/constants/ChannelConstants.js b/web/berry/src/constants/ChannelConstants.js index 7907c8d4fe..35a6afc352 100644 --- a/web/berry/src/constants/ChannelConstants.js +++ b/web/berry/src/constants/ChannelConstants.js @@ -179,6 +179,12 @@ export const CHANNEL_OPTIONS = { value: 44, color: 'primary' }, + 52: { + key: 52, + text: '七牛云', + value: 52, + color: 'primary' + }, 45: { key: 45, text: 'xAI', diff --git a/web/berry/src/views/Channel/type/Config.js b/web/berry/src/views/Channel/type/Config.js index 67b9073306..996191e502 100644 --- a/web/berry/src/views/Channel/type/Config.js +++ b/web/berry/src/views/Channel/type/Config.js @@ -228,6 +228,12 @@ const typeConfig = { 45: { modelGroup: 'xai' }, + 52: { + input: { + models: ['deepseek-v3'] + }, + modelGroup: 'qiniu' + }, }; export { defaultConfig, typeConfig }; diff --git a/web/default/src/constants/channel.constants.js b/web/default/src/constants/channel.constants.js index e1dd3b53f9..8caa20dac5 100644 --- a/web/default/src/constants/channel.constants.js +++ b/web/default/src/constants/channel.constants.js @@ -85,6 +85,12 @@ export const CHANNEL_OPTIONS = [ { key: 44, text: 'SiliconFlow', value: 44, color: 'blue' }, { key: 45, text: 'xAI', value: 45, color: 'blue' }, { key: 46, text: 'Replicate', value: 46, color: 'blue' }, + { + key: 52, + text: '七牛云', + value: 52, + color: 'blue', + }, { key: 8, text: '自定义渠道',