diff --git a/src/renderer/src/config/models.ts b/src/renderer/src/config/models.ts index 7eb1f314..fcce1eb6 100644 --- a/src/renderer/src/config/models.ts +++ b/src/renderer/src/config/models.ts @@ -798,6 +798,56 @@ export const SYSTEM_MODELS: Record = { group: '360Gpt' } ], + hunyuan: [ + { + id: 'hunyuan-pro', + provider: 'hunyuan', + name: 'hunyuan-pro', + group: 'Hunyuan' + }, + { + id: 'hunyuan-standard', + provider: 'hunyuan', + name: 'hunyuan-standard', + group: 'Hunyuan' + }, + { + id: 'hunyuan-lite', + provider: 'hunyuan', + name: 'hunyuan-lite', + group: 'Hunyuan' + }, + { + id: 'hunyuan-standard-256k', + provider: 'hunyuan', + name: 'hunyuan-standard-256k', + group: 'Hunyuan' + }, + { + id: 'hunyuan-vision', + provider: 'hunyuan', + name: 'hunyuan-vision', + group: 'Hunyuan' + }, + { + id: 'hunyuan-code', + provider: 'hunyuan', + name: 'hunyuan-code', + group: 'Hunyuan' + }, + { + id: 'hunyuan-role', + provider: 'hunyuan', + name: 'hunyuan-role', + group: 'Hunyuan' + }, + { + id: 'hunyuan-turbo', + provider: 'hunyuan', + name: 'hunyuan-turbo', + group: 'Hunyuan' + } + ], nvidia: [ { id: '01-ai/yi-large', diff --git a/src/renderer/src/config/providers.ts b/src/renderer/src/config/providers.ts index 46c831d6..f3b9fb8b 100644 --- a/src/renderer/src/config/providers.ts +++ b/src/renderer/src/config/providers.ts @@ -1,4 +1,5 @@ import ZhinaoProviderLogo from '@renderer/assets/images/models/360.png' +import HunyuanProviderLogo from '@renderer/assets/images/models/hunyuan.png' import AzureProviderLogo from '@renderer/assets/images/models/microsoft.png' import AiHubMixProviderLogo from '@renderer/assets/images/providers/aihubmix.jpg' import AnthropicProviderLogo from '@renderer/assets/images/providers/anthropic.png' @@ -76,6 +77,8 @@ export function getProviderLogo(providerId: string) { return NvidiaProviderLogo case 'azure-openai': return AzureProviderLogo + case 'hunyuan': + return HunyuanProviderLogo default: return undefined } @@ -328,6 +331,17 @@ export const PROVIDER_CONFIG = { models: 'https://ai.360.com/platform/limit' } }, + hunyuan: { + api: { + url: 'https://api.hunyuan.cloud.tencent.com' + }, + websites: { + official: 'https://cloud.tencent.com/product/hunyuan', + apiKey: 'https://console.cloud.tencent.com/hunyuan/api-key', + docs: 'https://cloud.tencent.com/document/product/1729/111007', + models: 'https://cloud.tencent.com/document/product/1729/104753' + } + }, nvidia: { api: { url: 'https://integrate.api.nvidia.com' diff --git a/src/renderer/src/i18n/en-us.json b/src/renderer/src/i18n/en-us.json index 54fc2978..4b4e1eb4 100644 --- a/src/renderer/src/i18n/en-us.json +++ b/src/renderer/src/i18n/en-us.json @@ -158,6 +158,7 @@ }, "provider": { "nvidia": "Nvidia", + "hunyuan": "Tencent Hunyuan", "zhinao": "360AI", "fireworks": "Fireworks", "together": "Together", diff --git a/src/renderer/src/i18n/zh-cn.json b/src/renderer/src/i18n/zh-cn.json index abe435c2..6ee67cc3 100644 --- a/src/renderer/src/i18n/zh-cn.json +++ b/src/renderer/src/i18n/zh-cn.json @@ -158,6 +158,7 @@ }, "provider": { "nvidia": "英伟达", + "hunyuan": "腾讯混元", "zhinao": "360智脑", "fireworks": "Fireworks", "together": "Together", diff --git a/src/renderer/src/i18n/zh-tw.json b/src/renderer/src/i18n/zh-tw.json index d07ae5aa..c7e8bd1a 100644 --- a/src/renderer/src/i18n/zh-tw.json +++ b/src/renderer/src/i18n/zh-tw.json @@ -159,6 +159,7 @@ "provider": { "nvidia": "輝達", "zhinao": "360智腦", + "hunyuan": "騰訊混元", "fireworks": "Fireworks", "together": "Together", "openai": "OpenAI", diff --git a/src/renderer/src/store/index.ts b/src/renderer/src/store/index.ts index 977dc189..7df481a8 100644 --- a/src/renderer/src/store/index.ts +++ b/src/renderer/src/store/index.ts @@ -22,7 +22,7 @@ const persistedReducer = persistReducer( { key: 'cherry-studio', storage, - version: 31, + version: 32, blacklist: ['runtime'], migrate }, diff --git a/src/renderer/src/store/llm.ts b/src/renderer/src/store/llm.ts index 57327ce2..39912f9d 100644 --- a/src/renderer/src/store/llm.ts +++ b/src/renderer/src/store/llm.ts @@ -231,6 +231,15 @@ const initialState: LlmState = { isSystem: true, enabled: false }, + { + id: 'hunyuan', + name: 'hunyuan', + apiKey: '', + apiHost: 'https://api.hunyuan.cloud.tencent.com', + models: SYSTEM_MODELS.hunyuan, + isSystem: true, + enabled: false + }, { id: 'nvidia', name: 'nvidia', diff --git a/src/renderer/src/store/migrate.ts b/src/renderer/src/store/migrate.ts index 24e31028..f5907e99 100644 --- a/src/renderer/src/store/migrate.ts +++ b/src/renderer/src/store/migrate.ts @@ -477,6 +477,15 @@ const migrateConfig = { isSystem: true, enabled: false }, + { + id: 'hunyuan', + name: 'hunyuan', + apiKey: '', + apiHost: 'https://api.hunyuan.cloud.tencent.com', + models: SYSTEM_MODELS.hunyuan, + isSystem: true, + enabled: false + }, { id: 'nvidia', name: 'Nvidia', @@ -539,6 +548,26 @@ const migrateConfig = { }) } } + }, + '32': (state: RootState) => { + return { + ...state, + llm: { + ...state.llm, + providers: [ + ...state.llm.providers, + { + id: 'hunyuan', + name: 'Hunyuan', + apiKey: '', + apiHost: 'https://api.hunyuan.cloud.tencent.com', + models: SYSTEM_MODELS.hunyuan, + isSystem: true, + enabled: false + } + ] + } + } } }