From 581ad5fbda0e52b7c7fcd2a60e7814b350e9f560 Mon Sep 17 00:00:00 2001 From: kangfenmao Date: Sun, 6 Apr 2025 18:50:30 +0800 Subject: [PATCH] feat: add qiniu ai provider --- .../src/assets/images/providers/qiniu.webp | Bin 0 -> 1930 bytes src/renderer/src/config/models.ts | 3 ++- src/renderer/src/config/providers.ts | 24 +++++++++++++----- src/renderer/src/i18n/locales/en-us.json | 3 ++- src/renderer/src/i18n/locales/ja-jp.json | 3 ++- src/renderer/src/i18n/locales/ru-ru.json | 3 ++- src/renderer/src/i18n/locales/zh-cn.json | 3 ++- src/renderer/src/i18n/locales/zh-tw.json | 3 ++- src/renderer/src/store/llm.ts | 10 ++++++++ src/renderer/src/store/migrate.ts | 1 + 10 files changed, 41 insertions(+), 12 deletions(-) create mode 100644 src/renderer/src/assets/images/providers/qiniu.webp diff --git a/src/renderer/src/assets/images/providers/qiniu.webp b/src/renderer/src/assets/images/providers/qiniu.webp new file mode 100644 index 0000000000000000000000000000000000000000..d3b908df134165e29d227a096b3e460fdaf720d6 GIT binary patch literal 1930 zcmV;52X**TNk&G32LJ$9MM6+kP&goV2LJ#tD*&AVD#!rH06vjKpi3pAqamd6*{HA* z2~FRRjIEYluk}1#aSYoc-qZRADrYVIW1e{@`mOR#M14c~f_}R6g!2LCN&V;5*Z6-( z4x%qYzL)RaD-|sQVW?~J|1;}mNls?Jp?)b0`0=Se!|q}a zWQp+JU!Ti~B)0dS%Hqhe%$;oh-i*{tKY(`cv&GlFZNXS}eDJ_|`Ra~pIbKcC z-ZpbZ0+CtqNM7{C>NVHuvh~v~LKKHeRgeKk*fU7&gkx*OKI@8}uNcb=SIL&($Z+Ui ztRhv?hVmXi?|py^V-DMk{DbhB6LH{NNYl;ki_W9#635t$tbiB~gf_Zd1z_CyaxYYW zO;n`Ps!{r<-*c3KL;vV-zySX3aX$fYj|y*p%kTNW_p+nTRsPfbT)uJ3QhG3{DQMq$ z*(aoIfkOpKw$>8A*$bf|5XnD1_X@04MlAo8*;UF}`_hZ#(b7RVJi#+C zS?$OB`DWz6;7uo86S*!5b%w4NIy|m|8lyT`@fqQVRZ?jof2)f&Fgvl>9-S~R{>w5E2OEEN0n~J`C~r(IyS;xe27?QY2>R?|nMvSFNq-QV5?rN5k4KuuvGN;5v7k0Zsow%rg zGV9pCHrWfoxR{tq^!7MeLqFT6(_+SZ%W(r!q(>QWn8bI6y47VXm5Augo%A-^&_kBf zLLY@r4_M!mo%6Iy>5Q=A@SS$y?w(Bd_BD^ik~L3FEB8N` zXstazVh??1vaQG2kq8ajg~o7A`r_|s2;f}Q(XNQFnPG+h1t@E&l|Slqs)P@j4h*Yt z{Wz&Iwd$YO#gK6h9OL+#-FX)|_4uNu|FOP6Nl$jtcLAO;Kp^fV`AOg|x>2rqiyQ;KN08YLR zGj4}7=0#(Cq`^Y1Ro_*%o+1|F;j-`mK0#C^DK2ZMpUfB$Q4b z@!5u@KOc#)tKPrVIOr@>LiGP+E*IpiuJR2wS)S%_0z_%!aBcbpUGnXEbce(J2{yW5o+pR*(xZFcwwaKX$dM;o1%#)ge7F8pz=Zb5?Vrdv|wg z4<6ot;M=XGx-qEp;-x>2x+5^-)B3v6u)hWOWLQyS3)361$+a-x Q{M>W6s^atw8~^|S07l@>H~;_u literal 0 HcmV?d00001 diff --git a/src/renderer/src/config/models.ts b/src/renderer/src/config/models.ts index 690c791c..40a215fd 100644 --- a/src/renderer/src/config/models.ts +++ b/src/renderer/src/config/models.ts @@ -2013,7 +2013,8 @@ export const SYSTEM_MODELS: Record = { name: 'rerank-2-lite', group: 'Voyage Rerank V2' } - ] + ], + qiniu: [] } export const TEXT_TO_IMAGES_MODELS = [ diff --git a/src/renderer/src/config/providers.ts b/src/renderer/src/config/providers.ts index b74dfa81..07e10528 100644 --- a/src/renderer/src/config/providers.ts +++ b/src/renderer/src/config/providers.ts @@ -32,6 +32,7 @@ import OpenAiProviderLogo from '@renderer/assets/images/providers/openai.png' import OpenRouterProviderLogo from '@renderer/assets/images/providers/openrouter.png' import PerplexityProviderLogo from '@renderer/assets/images/providers/perplexity.png' import PPIOProviderLogo from '@renderer/assets/images/providers/ppio.png' +import QiniuProviderLogo from '@renderer/assets/images/providers/qiniu.webp' import SiliconFlowProviderLogo from '@renderer/assets/images/providers/silicon.png' import StepProviderLogo from '@renderer/assets/images/providers/step.png' import TencentCloudProviderLogo from '@renderer/assets/images/providers/tencent-cloud-ti.png' @@ -86,7 +87,8 @@ const PROVIDER_LOGO_MAP = { 'tencent-cloud-ti': TencentCloudProviderLogo, gpustack: GPUStackProviderLogo, alayanew: AlayaNewProviderLogo, - voyageai: VoyageAIProviderLogo + voyageai: VoyageAIProviderLogo, + qiniu: QiniuProviderLogo } as const export function getProviderLogo(providerId: string) { @@ -123,10 +125,9 @@ export const PROVIDER_CONFIG = { url: 'https://api.ppinfra.com/v3/openai' }, websites: { - official: - 'https://ppinfra.com/model-api/product/llm-api?utm_source=github_cherry-studio&utm_medium=github_readme&utm_campaign=link', - apiKey: 'https://ppinfra.com/settings/key-management', - docs: 'https://ppinfra.com/docs/model-api/reference/llm/llm.html', + official: 'https://ppinfra.com/user/register?invited_by=JYT9GD&utm_source=github_cherry-studio', + apiKey: 'https://ppinfra.com/user/register?invited_by=JYT9GD&utm_source=github_cherry-studio', + docs: 'https://docs.cherry-ai.com/pre-basic/providers/ppio?invited_by=JYT9GD&utm_source=github_cherry-studio', models: 'https://ppinfra.com/model-api/product/llm-api?utm_source=github_cherry-studio&utm_medium=github_readme&utm_campaign=link' } @@ -148,7 +149,7 @@ export const PROVIDER_CONFIG = { }, websites: { official: 'https://www.siliconflow.cn/', - apiKey: 'https://cloud.siliconflow.cn/account/ak?referrer=clxty1xuy0014lvqwh5z50i88', + apiKey: 'https://cloud.siliconflow.cn/i/d1nTBKXU', docs: 'https://docs.siliconflow.cn/', models: 'https://docs.siliconflow.cn/docs/model-names' } @@ -571,5 +572,16 @@ export const PROVIDER_CONFIG = { docs: 'https://docs.voyageai.com/docs', models: 'https://docs.voyageai.com/docs' } + }, + qiniu: { + api: { + url: 'https://api.qnaigc.com' + }, + websites: { + official: 'https://qiniu.com', + apiKey: 'https://marketing.qiniu.com/activity/2025_newspring?cps_key=1h4vzfbkxobiq#deepseek-title', + docs: 'https://developer.qiniu.com/aitokenapi', + models: 'https://developer.qiniu.com/aitokenapi/12883/model-list' + } } } diff --git a/src/renderer/src/i18n/locales/en-us.json b/src/renderer/src/i18n/locales/en-us.json index 7d408a7c..0366ca52 100644 --- a/src/renderer/src/i18n/locales/en-us.json +++ b/src/renderer/src/i18n/locales/en-us.json @@ -737,7 +737,8 @@ "yi": "Yi", "zhinao": "360AI", "zhipu": "ZHIPU AI", - "voyageai": "Voyage AI" + "voyageai": "Voyage AI", + "qiniu": "Qiniu" }, "restore": { "confirm": "Are you sure you want to restore data?", diff --git a/src/renderer/src/i18n/locales/ja-jp.json b/src/renderer/src/i18n/locales/ja-jp.json index 959d9381..d8d67c5f 100644 --- a/src/renderer/src/i18n/locales/ja-jp.json +++ b/src/renderer/src/i18n/locales/ja-jp.json @@ -737,7 +737,8 @@ "yi": "零一万物", "zhinao": "360智脳", "zhipu": "智譜AI", - "voyageai": "Voyage AI" + "voyageai": "Voyage AI", + "qiniu": "七牛云" }, "restore": { "confirm": "データを復元しますか?", diff --git a/src/renderer/src/i18n/locales/ru-ru.json b/src/renderer/src/i18n/locales/ru-ru.json index 5bb1f71d..89430131 100644 --- a/src/renderer/src/i18n/locales/ru-ru.json +++ b/src/renderer/src/i18n/locales/ru-ru.json @@ -737,7 +737,8 @@ "yi": "Yi", "zhinao": "360AI", "zhipu": "ZHIPU AI", - "voyageai": "Voyage AI" + "voyageai": "Voyage AI", + "qiniu": "Qiniu" }, "restore": { "confirm": "Вы уверены, что хотите восстановить данные?", diff --git a/src/renderer/src/i18n/locales/zh-cn.json b/src/renderer/src/i18n/locales/zh-cn.json index 3b7189ac..41e4b9e5 100644 --- a/src/renderer/src/i18n/locales/zh-cn.json +++ b/src/renderer/src/i18n/locales/zh-cn.json @@ -737,7 +737,8 @@ "yi": "零一万物", "zhinao": "360智脑", "zhipu": "智谱AI", - "voyageai": "Voyage AI" + "voyageai": "Voyage AI", + "qiniu": "七牛云" }, "restore": { "confirm": "确定要恢复数据吗?", diff --git a/src/renderer/src/i18n/locales/zh-tw.json b/src/renderer/src/i18n/locales/zh-tw.json index 62bf5b8f..d7b937d7 100644 --- a/src/renderer/src/i18n/locales/zh-tw.json +++ b/src/renderer/src/i18n/locales/zh-tw.json @@ -737,7 +737,8 @@ "yi": "零一萬物", "zhinao": "360 智腦", "zhipu": "智譜 AI", - "voyageai": "Voyage AI" + "voyageai": "Voyage AI", + "qiniu": "七牛雲" }, "restore": { "confirm": "確定要復原資料嗎?", diff --git a/src/renderer/src/store/llm.ts b/src/renderer/src/store/llm.ts index 8e9c29fa..2dabaf22 100644 --- a/src/renderer/src/store/llm.ts +++ b/src/renderer/src/store/llm.ts @@ -136,6 +136,16 @@ export const INITIAL_PROVIDERS: Provider[] = [ isSystem: true, enabled: false }, + { + id: 'qiniu', + name: 'Qiniu', + type: 'openai', + apiKey: '', + apiHost: 'https://api.qnaigc.com', + models: SYSTEM_MODELS.qiniu, + isSystem: true, + enabled: false + }, { id: 'baidu-cloud', name: 'Baidu Cloud', diff --git a/src/renderer/src/store/migrate.ts b/src/renderer/src/store/migrate.ts index 7823c64d..86133ba1 100644 --- a/src/renderer/src/store/migrate.ts +++ b/src/renderer/src/store/migrate.ts @@ -1193,6 +1193,7 @@ const migrateConfig = { state.settings.codeCacheMaxSize = 1000 state.settings.codeCacheTTL = 15 state.settings.codeCacheThreshold = 2 + addProvider(state, 'qiniu') return state } catch (error) { return state