mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-30 07:39:06 +08:00
feat: add PH8 provider support (#7756)
- Introduced PH8 provider with configuration and logo. - Updated SYSTEM_MODELS to include PH8 models. - Added PH8 to internationalization files for multiple languages. - Implemented migration logic to integrate PH8 into the existing provider structure. Co-authored-by: jack.li <jack.li@enflame-tech.com>
This commit is contained in:
parent
25d6a1f02f
commit
f163ace86c
BIN
src/renderer/src/assets/images/providers/ph8.png
Normal file
BIN
src/renderer/src/assets/images/providers/ph8.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 8.1 KiB |
@ -50,8 +50,8 @@ import { default as GoogleModelLogo, default as GoogleModelLogoDark } from '@ren
|
||||
import ChatGPT35ModelLogo from '@renderer/assets/images/models/gpt_3.5.png'
|
||||
import ChatGPT4ModelLogo from '@renderer/assets/images/models/gpt_4.png'
|
||||
import {
|
||||
default as ChatGPT4ModelLogoDark,
|
||||
default as ChatGPT35ModelLogoDark,
|
||||
default as ChatGPT4ModelLogoDark,
|
||||
default as ChatGptModelLogoDakr,
|
||||
default as ChatGPTo1ModelLogoDark
|
||||
} from '@renderer/assets/images/models/gpt_dark.png'
|
||||
@ -524,6 +524,20 @@ export const SYSTEM_MODELS: Record<string, Model[]> = {
|
||||
group: 'Jina AI'
|
||||
}
|
||||
],
|
||||
ph8: [
|
||||
{
|
||||
id: 'deepseek-v3-241226',
|
||||
name: 'deepseek-v3-241226',
|
||||
provider: 'ph8',
|
||||
group: 'DeepSeek'
|
||||
},
|
||||
{
|
||||
id: 'deepseek-r1-250120',
|
||||
name: 'deepseek-r1-250120',
|
||||
provider: 'ph8',
|
||||
group: 'DeepSeek'
|
||||
}
|
||||
],
|
||||
aihubmix: [
|
||||
{
|
||||
id: 'o3',
|
||||
|
||||
@ -35,6 +35,7 @@ import OllamaProviderLogo from '@renderer/assets/images/providers/ollama.png'
|
||||
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 Ph8ProviderLogo from '@renderer/assets/images/providers/ph8.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'
|
||||
@ -52,6 +53,7 @@ import ZhipuProviderLogo from '@renderer/assets/images/providers/zhipu.png'
|
||||
import { TOKENFLUX_HOST } from './constant'
|
||||
|
||||
const PROVIDER_LOGO_MAP = {
|
||||
ph8: Ph8ProviderLogo,
|
||||
'302ai': Ai302ProviderLogo,
|
||||
openai: OpenAiProviderLogo,
|
||||
silicon: SiliconFlowProviderLogo,
|
||||
@ -114,6 +116,17 @@ export const NOT_SUPPORTED_REANK_PROVIDERS = ['ollama']
|
||||
export const ONLY_SUPPORTED_DIMENSION_PROVIDERS = ['ollama', 'infini']
|
||||
|
||||
export const PROVIDER_CONFIG = {
|
||||
ph8: {
|
||||
api: {
|
||||
url: 'https://ph8.co'
|
||||
},
|
||||
websites: {
|
||||
official: 'https://ph8.co',
|
||||
apiKey: 'https://ph8.co/apiKey',
|
||||
docs: 'https://m1r239or5aw.feishu.cn/wiki/SegzwS4x1i2P4OksFY2cMvujn9f',
|
||||
models: 'https://ph8.co/v1/models'
|
||||
}
|
||||
},
|
||||
'302ai': {
|
||||
api: {
|
||||
url: 'https://api.302.ai'
|
||||
|
||||
@ -1060,7 +1060,8 @@
|
||||
"tokenflux": "TokenFlux",
|
||||
"302ai": "302.AI",
|
||||
"lanyun": "LANYUN",
|
||||
"vertexai": "Vertex AI"
|
||||
"vertexai": "Vertex AI",
|
||||
"ph8": "PH8"
|
||||
},
|
||||
"restore": {
|
||||
"confirm": "Are you sure you want to restore data?",
|
||||
|
||||
@ -1060,7 +1060,8 @@
|
||||
"302ai": "302.AI",
|
||||
"cephalon": "Cephalon",
|
||||
"lanyun": "LANYUN",
|
||||
"vertexai": "Vertex AI"
|
||||
"vertexai": "Vertex AI",
|
||||
"ph8": "PH8"
|
||||
},
|
||||
"restore": {
|
||||
"confirm": "データを復元しますか?",
|
||||
|
||||
@ -1060,7 +1060,8 @@
|
||||
"tokenflux": "TokenFlux",
|
||||
"302ai": "302.AI",
|
||||
"lanyun": "LANYUN",
|
||||
"vertexai": "Vertex AI"
|
||||
"vertexai": "Vertex AI",
|
||||
"ph8": "PH8"
|
||||
},
|
||||
"restore": {
|
||||
"confirm": "Вы уверены, что хотите восстановить данные?",
|
||||
|
||||
@ -1060,7 +1060,8 @@
|
||||
"tokenflux": "TokenFlux",
|
||||
"302ai": "302.AI",
|
||||
"lanyun": "蓝耘科技",
|
||||
"vertexai": "Vertex AI"
|
||||
"vertexai": "Vertex AI",
|
||||
"ph8": "PH8大模型开放平台"
|
||||
},
|
||||
"restore": {
|
||||
"confirm": "确定要恢复数据吗?",
|
||||
|
||||
@ -1060,7 +1060,8 @@
|
||||
"tokenflux": "TokenFlux",
|
||||
"302ai": "302.AI",
|
||||
"lanyun": "藍耘",
|
||||
"vertexai": "Vertex AI"
|
||||
"vertexai": "Vertex AI",
|
||||
"ph8": "PH8大模型開放平台"
|
||||
},
|
||||
"restore": {
|
||||
"confirm": "確定要復原資料嗎?",
|
||||
|
||||
@ -144,6 +144,16 @@ export const INITIAL_PROVIDERS: Provider[] = [
|
||||
isSystem: true,
|
||||
enabled: false
|
||||
},
|
||||
{
|
||||
id: 'ph8',
|
||||
name: 'PH8',
|
||||
type: 'openai',
|
||||
apiKey: '',
|
||||
apiHost: 'https://ph8.co',
|
||||
models: SYSTEM_MODELS.ph8,
|
||||
isSystem: true,
|
||||
enabled: false
|
||||
},
|
||||
{
|
||||
id: 'cephalon',
|
||||
name: 'Cephalon',
|
||||
|
||||
@ -1754,6 +1754,15 @@ const migrateConfig = {
|
||||
} catch (error) {
|
||||
return state
|
||||
}
|
||||
},
|
||||
'119': (state: RootState) => {
|
||||
try {
|
||||
addProvider(state, 'ph8')
|
||||
state.llm.providers = moveProvider(state.llm.providers, 'ph8', 3)
|
||||
return state
|
||||
} catch (error) {
|
||||
return state
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user