mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-26 11:44:28 +08:00
refactor(providers): 将系统提供商配置移动到config/providers文件
This commit is contained in:
parent
1b572e7b4d
commit
dd762804c2
@ -52,9 +52,549 @@ import VoyageAIProviderLogo from '@renderer/assets/images/providers/voyageai.png
|
||||
import XirangProviderLogo from '@renderer/assets/images/providers/xirang.png'
|
||||
import ZeroOneProviderLogo from '@renderer/assets/images/providers/zero-one.png'
|
||||
import ZhipuProviderLogo from '@renderer/assets/images/providers/zhipu.png'
|
||||
import { Provider } from '@renderer/types'
|
||||
import { OpenAIServiceTiers, Provider, SystemProvider, SystemProviderId } from '@renderer/types'
|
||||
|
||||
import { TOKENFLUX_HOST } from './constant'
|
||||
import { SYSTEM_MODELS } from './models'
|
||||
|
||||
export const SYSTEM_PROVIDERS_CONFIG: Record<SystemProviderId, SystemProvider> = {
|
||||
silicon: {
|
||||
id: 'silicon',
|
||||
name: 'Silicon',
|
||||
type: 'openai',
|
||||
apiKey: '',
|
||||
apiHost: 'https://api.siliconflow.cn',
|
||||
models: SYSTEM_MODELS.silicon,
|
||||
isSystem: true,
|
||||
enabled: true
|
||||
},
|
||||
aihubmix: {
|
||||
id: 'aihubmix',
|
||||
name: 'AiHubMix',
|
||||
type: 'openai',
|
||||
apiKey: '',
|
||||
apiHost: 'https://aihubmix.com',
|
||||
models: SYSTEM_MODELS.aihubmix,
|
||||
isSystem: true,
|
||||
enabled: false
|
||||
},
|
||||
ocoolai: {
|
||||
id: 'ocoolai',
|
||||
name: 'ocoolAI',
|
||||
type: 'openai',
|
||||
apiKey: '',
|
||||
apiHost: 'https://api.ocoolai.com',
|
||||
models: SYSTEM_MODELS.ocoolai,
|
||||
isSystem: true,
|
||||
enabled: false
|
||||
},
|
||||
deepseek: {
|
||||
id: 'deepseek',
|
||||
name: 'deepseek',
|
||||
type: 'openai',
|
||||
apiKey: '',
|
||||
apiHost: 'https://api.deepseek.com',
|
||||
models: SYSTEM_MODELS.deepseek,
|
||||
isSystem: true,
|
||||
enabled: false,
|
||||
isNotSupportArrayContent: true
|
||||
},
|
||||
ppio: {
|
||||
id: 'ppio',
|
||||
name: 'PPIO',
|
||||
type: 'openai',
|
||||
apiKey: '',
|
||||
apiHost: 'https://api.ppinfra.com/v3/openai/',
|
||||
models: SYSTEM_MODELS.ppio,
|
||||
isSystem: true,
|
||||
enabled: false
|
||||
},
|
||||
alayanew: {
|
||||
id: 'alayanew',
|
||||
name: 'AlayaNew',
|
||||
type: 'openai',
|
||||
apiKey: '',
|
||||
apiHost: 'https://deepseek.alayanew.com',
|
||||
models: SYSTEM_MODELS.alayanew,
|
||||
isSystem: true,
|
||||
enabled: false
|
||||
},
|
||||
qiniu: {
|
||||
id: 'qiniu',
|
||||
name: 'Qiniu',
|
||||
type: 'openai',
|
||||
apiKey: '',
|
||||
apiHost: 'https://api.qnaigc.com',
|
||||
models: SYSTEM_MODELS.qiniu,
|
||||
isSystem: true,
|
||||
enabled: false
|
||||
},
|
||||
dmxapi: {
|
||||
id: 'dmxapi',
|
||||
name: 'DMXAPI',
|
||||
type: 'openai',
|
||||
apiKey: '',
|
||||
apiHost: 'https://www.dmxapi.cn',
|
||||
models: SYSTEM_MODELS.dmxapi,
|
||||
isSystem: true,
|
||||
enabled: false
|
||||
},
|
||||
burncloud: {
|
||||
id: 'burncloud',
|
||||
name: 'BurnCloud',
|
||||
type: 'openai',
|
||||
apiKey: '',
|
||||
apiHost: 'https://ai.burncloud.com',
|
||||
models: SYSTEM_MODELS.burncloud,
|
||||
isSystem: true,
|
||||
enabled: false
|
||||
},
|
||||
tokenflux: {
|
||||
id: 'tokenflux',
|
||||
name: 'TokenFlux',
|
||||
type: 'openai',
|
||||
apiKey: '',
|
||||
apiHost: 'https://tokenflux.ai',
|
||||
models: SYSTEM_MODELS.tokenflux,
|
||||
isSystem: true,
|
||||
enabled: false
|
||||
},
|
||||
'302ai': {
|
||||
id: '302ai',
|
||||
name: '302.AI',
|
||||
type: 'openai',
|
||||
apiKey: '',
|
||||
apiHost: 'https://api.302.ai',
|
||||
models: SYSTEM_MODELS['302ai'],
|
||||
isSystem: true,
|
||||
enabled: false
|
||||
},
|
||||
cephalon: {
|
||||
id: 'cephalon',
|
||||
name: 'Cephalon',
|
||||
type: 'openai',
|
||||
apiKey: '',
|
||||
apiHost: 'https://cephalon.cloud/user-center/v1/model',
|
||||
models: SYSTEM_MODELS.cephalon,
|
||||
isSystem: true,
|
||||
enabled: false
|
||||
},
|
||||
lanyun: {
|
||||
id: 'lanyun',
|
||||
name: 'LANYUN',
|
||||
type: 'openai',
|
||||
apiKey: '',
|
||||
apiHost: 'https://maas-api.lanyun.net',
|
||||
models: SYSTEM_MODELS.lanyun,
|
||||
isSystem: true,
|
||||
enabled: false
|
||||
},
|
||||
ph8: {
|
||||
id: 'ph8',
|
||||
name: 'PH8',
|
||||
type: 'openai',
|
||||
apiKey: '',
|
||||
apiHost: 'https://ph8.co',
|
||||
models: SYSTEM_MODELS.ph8,
|
||||
isSystem: true,
|
||||
enabled: false
|
||||
},
|
||||
openrouter: {
|
||||
id: 'openrouter',
|
||||
name: 'OpenRouter',
|
||||
type: 'openai',
|
||||
apiKey: '',
|
||||
apiHost: 'https://openrouter.ai/api/v1/',
|
||||
models: SYSTEM_MODELS.openrouter,
|
||||
isSystem: true,
|
||||
enabled: false
|
||||
},
|
||||
ollama: {
|
||||
id: 'ollama',
|
||||
name: 'Ollama',
|
||||
type: 'openai',
|
||||
apiKey: '',
|
||||
apiHost: 'http://localhost:11434',
|
||||
models: SYSTEM_MODELS.ollama,
|
||||
isSystem: true,
|
||||
enabled: false
|
||||
},
|
||||
'new-api': {
|
||||
id: 'new-api',
|
||||
name: 'New API',
|
||||
type: 'openai',
|
||||
apiKey: '',
|
||||
apiHost: 'http://localhost:3000',
|
||||
models: SYSTEM_MODELS['new-api'],
|
||||
isSystem: true,
|
||||
enabled: false
|
||||
},
|
||||
lmstudio: {
|
||||
id: 'lmstudio',
|
||||
name: 'LM Studio',
|
||||
type: 'openai',
|
||||
apiKey: '',
|
||||
apiHost: 'http://localhost:1234',
|
||||
models: SYSTEM_MODELS.lmstudio,
|
||||
isSystem: true,
|
||||
enabled: false
|
||||
},
|
||||
anthropic: {
|
||||
id: 'anthropic',
|
||||
name: 'Anthropic',
|
||||
type: 'anthropic',
|
||||
apiKey: '',
|
||||
apiHost: 'https://api.anthropic.com/',
|
||||
models: SYSTEM_MODELS.anthropic,
|
||||
isSystem: true,
|
||||
enabled: false
|
||||
},
|
||||
openai: {
|
||||
id: 'openai',
|
||||
name: 'OpenAI',
|
||||
type: 'openai-response',
|
||||
apiKey: '',
|
||||
apiHost: 'https://api.openai.com',
|
||||
models: SYSTEM_MODELS.openai,
|
||||
isSystem: true,
|
||||
enabled: false,
|
||||
isSupportServiceTier: true,
|
||||
serviceTier: OpenAIServiceTiers.AUTO
|
||||
},
|
||||
'azure-openai': {
|
||||
id: 'azure-openai',
|
||||
name: 'Azure OpenAI',
|
||||
type: 'azure-openai',
|
||||
apiKey: '',
|
||||
apiHost: '',
|
||||
apiVersion: '',
|
||||
models: SYSTEM_MODELS['azure-openai'],
|
||||
isSystem: true,
|
||||
enabled: false
|
||||
},
|
||||
gemini: {
|
||||
id: 'gemini',
|
||||
name: 'Gemini',
|
||||
type: 'gemini',
|
||||
apiKey: '',
|
||||
apiHost: 'https://generativelanguage.googleapis.com',
|
||||
models: SYSTEM_MODELS.gemini,
|
||||
isSystem: true,
|
||||
enabled: false,
|
||||
isVertex: false
|
||||
},
|
||||
vertexai: {
|
||||
id: 'vertexai',
|
||||
name: 'VertexAI',
|
||||
type: 'vertexai',
|
||||
apiKey: '',
|
||||
apiHost: 'https://aiplatform.googleapis.com',
|
||||
models: [],
|
||||
isSystem: true,
|
||||
enabled: false,
|
||||
isVertex: true
|
||||
},
|
||||
github: {
|
||||
id: 'github',
|
||||
name: 'Github Models',
|
||||
type: 'openai',
|
||||
apiKey: '',
|
||||
apiHost: 'https://models.inference.ai.azure.com/',
|
||||
models: SYSTEM_MODELS.github,
|
||||
isSystem: true,
|
||||
enabled: false
|
||||
},
|
||||
copilot: {
|
||||
id: 'copilot',
|
||||
name: 'Github Copilot',
|
||||
type: 'openai',
|
||||
apiKey: '',
|
||||
apiHost: 'https://api.githubcopilot.com/',
|
||||
models: SYSTEM_MODELS.copilot,
|
||||
isSystem: true,
|
||||
enabled: false,
|
||||
isAuthed: false
|
||||
},
|
||||
zhipu: {
|
||||
id: 'zhipu',
|
||||
name: 'ZhiPu',
|
||||
type: 'openai',
|
||||
apiKey: '',
|
||||
apiHost: 'https://open.bigmodel.cn/api/paas/v4/',
|
||||
models: SYSTEM_MODELS.zhipu,
|
||||
isSystem: true,
|
||||
enabled: false
|
||||
},
|
||||
yi: {
|
||||
id: 'yi',
|
||||
name: 'Yi',
|
||||
type: 'openai',
|
||||
apiKey: '',
|
||||
apiHost: 'https://api.lingyiwanwu.com',
|
||||
models: SYSTEM_MODELS.yi,
|
||||
isSystem: true,
|
||||
enabled: false
|
||||
},
|
||||
moonshot: {
|
||||
id: 'moonshot',
|
||||
name: 'Moonshot AI',
|
||||
type: 'openai',
|
||||
apiKey: '',
|
||||
apiHost: 'https://api.moonshot.cn',
|
||||
models: SYSTEM_MODELS.moonshot,
|
||||
isSystem: true,
|
||||
enabled: false
|
||||
},
|
||||
baichuan: {
|
||||
id: 'baichuan',
|
||||
name: 'BAICHUAN AI',
|
||||
type: 'openai',
|
||||
apiKey: '',
|
||||
apiHost: 'https://api.baichuan-ai.com',
|
||||
models: SYSTEM_MODELS.baichuan,
|
||||
isSystem: true,
|
||||
enabled: false,
|
||||
isNotSupportArrayContent: true
|
||||
},
|
||||
dashscope: {
|
||||
id: 'dashscope',
|
||||
name: 'Bailian',
|
||||
type: 'openai',
|
||||
apiKey: '',
|
||||
apiHost: 'https://dashscope.aliyuncs.com/compatible-mode/v1/',
|
||||
models: SYSTEM_MODELS.bailian,
|
||||
isSystem: true,
|
||||
enabled: false
|
||||
},
|
||||
stepfun: {
|
||||
id: 'stepfun',
|
||||
name: 'StepFun',
|
||||
type: 'openai',
|
||||
apiKey: '',
|
||||
apiHost: 'https://api.stepfun.com',
|
||||
models: SYSTEM_MODELS.stepfun,
|
||||
isSystem: true,
|
||||
enabled: false
|
||||
},
|
||||
doubao: {
|
||||
id: 'doubao',
|
||||
name: 'doubao',
|
||||
type: 'openai',
|
||||
apiKey: '',
|
||||
apiHost: 'https://ark.cn-beijing.volces.com/api/v3/',
|
||||
models: SYSTEM_MODELS.doubao,
|
||||
isSystem: true,
|
||||
enabled: false
|
||||
},
|
||||
infini: {
|
||||
id: 'infini',
|
||||
name: 'Infini',
|
||||
type: 'openai',
|
||||
apiKey: '',
|
||||
apiHost: 'https://cloud.infini-ai.com/maas',
|
||||
models: SYSTEM_MODELS.infini,
|
||||
isSystem: true,
|
||||
enabled: false
|
||||
},
|
||||
minimax: {
|
||||
id: 'minimax',
|
||||
name: 'MiniMax',
|
||||
type: 'openai',
|
||||
apiKey: '',
|
||||
apiHost: 'https://api.minimax.chat/v1/',
|
||||
models: SYSTEM_MODELS.minimax,
|
||||
isSystem: true,
|
||||
enabled: false,
|
||||
isNotSupportArrayContent: true
|
||||
},
|
||||
groq: {
|
||||
id: 'groq',
|
||||
name: 'Groq',
|
||||
type: 'openai',
|
||||
apiKey: '',
|
||||
apiHost: 'https://api.groq.com/openai',
|
||||
models: SYSTEM_MODELS.groq,
|
||||
isSystem: true,
|
||||
enabled: false,
|
||||
isSupportServiceTier: true,
|
||||
serviceTier: OpenAIServiceTiers.DEFAULT
|
||||
},
|
||||
together: {
|
||||
id: 'together',
|
||||
name: 'Together',
|
||||
type: 'openai',
|
||||
apiKey: '',
|
||||
apiHost: 'https://api.together.xyz',
|
||||
models: SYSTEM_MODELS.together,
|
||||
isSystem: true,
|
||||
enabled: false
|
||||
},
|
||||
fireworks: {
|
||||
id: 'fireworks',
|
||||
name: 'Fireworks',
|
||||
type: 'openai',
|
||||
apiKey: '',
|
||||
apiHost: 'https://api.fireworks.ai/inference',
|
||||
models: SYSTEM_MODELS.fireworks,
|
||||
isSystem: true,
|
||||
enabled: false
|
||||
},
|
||||
nvidia: {
|
||||
id: 'nvidia',
|
||||
name: 'nvidia',
|
||||
type: 'openai',
|
||||
apiKey: '',
|
||||
apiHost: 'https://integrate.api.nvidia.com',
|
||||
models: SYSTEM_MODELS.nvidia,
|
||||
isSystem: true,
|
||||
enabled: false
|
||||
},
|
||||
grok: {
|
||||
id: 'grok',
|
||||
name: 'Grok',
|
||||
type: 'openai',
|
||||
apiKey: '',
|
||||
apiHost: 'https://api.x.ai',
|
||||
models: SYSTEM_MODELS.grok,
|
||||
isSystem: true,
|
||||
enabled: false
|
||||
},
|
||||
hyperbolic: {
|
||||
id: 'hyperbolic',
|
||||
name: 'Hyperbolic',
|
||||
type: 'openai',
|
||||
apiKey: '',
|
||||
apiHost: 'https://api.hyperbolic.xyz',
|
||||
models: SYSTEM_MODELS.hyperbolic,
|
||||
isSystem: true,
|
||||
enabled: false
|
||||
},
|
||||
mistral: {
|
||||
id: 'mistral',
|
||||
name: 'Mistral',
|
||||
type: 'openai',
|
||||
apiKey: '',
|
||||
apiHost: 'https://api.mistral.ai',
|
||||
models: SYSTEM_MODELS.mistral,
|
||||
isSystem: true,
|
||||
enabled: false,
|
||||
isNotSupportStreamOptions: true
|
||||
},
|
||||
jina: {
|
||||
id: 'jina',
|
||||
name: 'Jina',
|
||||
type: 'openai',
|
||||
apiKey: '',
|
||||
apiHost: 'https://api.jina.ai',
|
||||
models: SYSTEM_MODELS.jina,
|
||||
isSystem: true,
|
||||
enabled: false
|
||||
},
|
||||
perplexity: {
|
||||
id: 'perplexity',
|
||||
name: 'Perplexity',
|
||||
type: 'openai',
|
||||
apiKey: '',
|
||||
apiHost: 'https://api.perplexity.ai/',
|
||||
models: SYSTEM_MODELS.perplexity,
|
||||
isSystem: true,
|
||||
enabled: false
|
||||
},
|
||||
modelscope: {
|
||||
id: 'modelscope',
|
||||
name: 'ModelScope',
|
||||
type: 'openai',
|
||||
apiKey: '',
|
||||
apiHost: 'https://api-inference.modelscope.cn/v1/',
|
||||
models: SYSTEM_MODELS.modelscope,
|
||||
isSystem: true,
|
||||
enabled: false
|
||||
},
|
||||
xirang: {
|
||||
id: 'xirang',
|
||||
name: 'Xirang',
|
||||
type: 'openai',
|
||||
apiKey: '',
|
||||
apiHost: 'https://wishub-x1.ctyun.cn',
|
||||
models: SYSTEM_MODELS.xirang,
|
||||
isSystem: true,
|
||||
enabled: false,
|
||||
isNotSupportArrayContent: true
|
||||
},
|
||||
hunyuan: {
|
||||
id: 'hunyuan',
|
||||
name: 'hunyuan',
|
||||
type: 'openai',
|
||||
apiKey: '',
|
||||
apiHost: 'https://api.hunyuan.cloud.tencent.com',
|
||||
models: SYSTEM_MODELS.hunyuan,
|
||||
isSystem: true,
|
||||
enabled: false
|
||||
},
|
||||
'tencent-cloud-ti': {
|
||||
id: 'tencent-cloud-ti',
|
||||
name: 'Tencent Cloud TI',
|
||||
type: 'openai',
|
||||
apiKey: '',
|
||||
apiHost: 'https://api.lkeap.cloud.tencent.com',
|
||||
models: SYSTEM_MODELS['tencent-cloud-ti'],
|
||||
isSystem: true,
|
||||
enabled: false
|
||||
},
|
||||
'baidu-cloud': {
|
||||
id: 'baidu-cloud',
|
||||
name: 'Baidu Cloud',
|
||||
type: 'openai',
|
||||
apiKey: '',
|
||||
apiHost: 'https://qianfan.baidubce.com/v2/',
|
||||
models: SYSTEM_MODELS['baidu-cloud'],
|
||||
isSystem: true,
|
||||
enabled: false
|
||||
},
|
||||
gpustack: {
|
||||
id: 'gpustack',
|
||||
name: 'GPUStack',
|
||||
type: 'openai',
|
||||
apiKey: '',
|
||||
apiHost: '',
|
||||
models: SYSTEM_MODELS.gpustack,
|
||||
isSystem: true,
|
||||
enabled: false
|
||||
},
|
||||
voyageai: {
|
||||
id: 'voyageai',
|
||||
name: 'VoyageAI',
|
||||
type: 'openai',
|
||||
apiKey: '',
|
||||
apiHost: 'https://api.voyageai.com',
|
||||
models: SYSTEM_MODELS.voyageai,
|
||||
isSystem: true,
|
||||
enabled: false
|
||||
},
|
||||
'aws-bedrock': {
|
||||
id: 'aws-bedrock',
|
||||
name: 'AWS Bedrock',
|
||||
type: 'aws-bedrock',
|
||||
apiKey: '',
|
||||
apiHost: '',
|
||||
models: SYSTEM_MODELS['aws-bedrock'],
|
||||
isSystem: true,
|
||||
enabled: false
|
||||
},
|
||||
poe: {
|
||||
id: 'poe',
|
||||
name: 'Poe',
|
||||
type: 'openai',
|
||||
apiKey: '',
|
||||
apiHost: 'https://api.poe.com/v1/',
|
||||
models: SYSTEM_MODELS['poe'],
|
||||
isSystem: true,
|
||||
enabled: false,
|
||||
isNotSupportDeveloperRole: true
|
||||
}
|
||||
} as const
|
||||
|
||||
export const SYSTEM_PROVIDERS: SystemProvider[] = Object.values(SYSTEM_PROVIDERS_CONFIG)
|
||||
|
||||
const PROVIDER_LOGO_MAP = {
|
||||
ph8: Ph8ProviderLogo,
|
||||
|
||||
@ -1,7 +1,8 @@
|
||||
import { createSlice, PayloadAction } from '@reduxjs/toolkit'
|
||||
import { isLocalAi } from '@renderer/config/env'
|
||||
import { SYSTEM_MODELS } from '@renderer/config/models'
|
||||
import { Model, OpenAIServiceTiers, Provider, SystemProvider, SystemProviderId } from '@renderer/types'
|
||||
import { SYSTEM_PROVIDERS } from '@renderer/config/providers'
|
||||
import { Model, Provider } from '@renderer/types'
|
||||
import { uniqBy } from 'lodash'
|
||||
|
||||
type LlmSettings = {
|
||||
@ -38,545 +39,6 @@ export interface LlmState {
|
||||
settings: LlmSettings
|
||||
}
|
||||
|
||||
const SYSTEM_PROVIDERS_CONFIG: Record<SystemProviderId, SystemProvider> = {
|
||||
silicon: {
|
||||
id: 'silicon',
|
||||
name: 'Silicon',
|
||||
type: 'openai',
|
||||
apiKey: '',
|
||||
apiHost: 'https://api.siliconflow.cn',
|
||||
models: SYSTEM_MODELS.silicon,
|
||||
isSystem: true,
|
||||
enabled: true
|
||||
},
|
||||
aihubmix: {
|
||||
id: 'aihubmix',
|
||||
name: 'AiHubMix',
|
||||
type: 'openai',
|
||||
apiKey: '',
|
||||
apiHost: 'https://aihubmix.com',
|
||||
models: SYSTEM_MODELS.aihubmix,
|
||||
isSystem: true,
|
||||
enabled: false
|
||||
},
|
||||
ocoolai: {
|
||||
id: 'ocoolai',
|
||||
name: 'ocoolAI',
|
||||
type: 'openai',
|
||||
apiKey: '',
|
||||
apiHost: 'https://api.ocoolai.com',
|
||||
models: SYSTEM_MODELS.ocoolai,
|
||||
isSystem: true,
|
||||
enabled: false
|
||||
},
|
||||
deepseek: {
|
||||
id: 'deepseek',
|
||||
name: 'deepseek',
|
||||
type: 'openai',
|
||||
apiKey: '',
|
||||
apiHost: 'https://api.deepseek.com',
|
||||
models: SYSTEM_MODELS.deepseek,
|
||||
isSystem: true,
|
||||
enabled: false,
|
||||
isNotSupportArrayContent: true
|
||||
},
|
||||
ppio: {
|
||||
id: 'ppio',
|
||||
name: 'PPIO',
|
||||
type: 'openai',
|
||||
apiKey: '',
|
||||
apiHost: 'https://api.ppinfra.com/v3/openai/',
|
||||
models: SYSTEM_MODELS.ppio,
|
||||
isSystem: true,
|
||||
enabled: false
|
||||
},
|
||||
alayanew: {
|
||||
id: 'alayanew',
|
||||
name: 'AlayaNew',
|
||||
type: 'openai',
|
||||
apiKey: '',
|
||||
apiHost: 'https://deepseek.alayanew.com',
|
||||
models: SYSTEM_MODELS.alayanew,
|
||||
isSystem: true,
|
||||
enabled: false
|
||||
},
|
||||
qiniu: {
|
||||
id: 'qiniu',
|
||||
name: 'Qiniu',
|
||||
type: 'openai',
|
||||
apiKey: '',
|
||||
apiHost: 'https://api.qnaigc.com',
|
||||
models: SYSTEM_MODELS.qiniu,
|
||||
isSystem: true,
|
||||
enabled: false
|
||||
},
|
||||
dmxapi: {
|
||||
id: 'dmxapi',
|
||||
name: 'DMXAPI',
|
||||
type: 'openai',
|
||||
apiKey: '',
|
||||
apiHost: 'https://www.dmxapi.cn',
|
||||
models: SYSTEM_MODELS.dmxapi,
|
||||
isSystem: true,
|
||||
enabled: false
|
||||
},
|
||||
burncloud: {
|
||||
id: 'burncloud',
|
||||
name: 'BurnCloud',
|
||||
type: 'openai',
|
||||
apiKey: '',
|
||||
apiHost: 'https://ai.burncloud.com',
|
||||
models: SYSTEM_MODELS.burncloud,
|
||||
isSystem: true,
|
||||
enabled: false
|
||||
},
|
||||
tokenflux: {
|
||||
id: 'tokenflux',
|
||||
name: 'TokenFlux',
|
||||
type: 'openai',
|
||||
apiKey: '',
|
||||
apiHost: 'https://tokenflux.ai',
|
||||
models: SYSTEM_MODELS.tokenflux,
|
||||
isSystem: true,
|
||||
enabled: false
|
||||
},
|
||||
'302ai': {
|
||||
id: '302ai',
|
||||
name: '302.AI',
|
||||
type: 'openai',
|
||||
apiKey: '',
|
||||
apiHost: 'https://api.302.ai',
|
||||
models: SYSTEM_MODELS['302ai'],
|
||||
isSystem: true,
|
||||
enabled: false
|
||||
},
|
||||
cephalon: {
|
||||
id: 'cephalon',
|
||||
name: 'Cephalon',
|
||||
type: 'openai',
|
||||
apiKey: '',
|
||||
apiHost: 'https://cephalon.cloud/user-center/v1/model',
|
||||
models: SYSTEM_MODELS.cephalon,
|
||||
isSystem: true,
|
||||
enabled: false
|
||||
},
|
||||
lanyun: {
|
||||
id: 'lanyun',
|
||||
name: 'LANYUN',
|
||||
type: 'openai',
|
||||
apiKey: '',
|
||||
apiHost: 'https://maas-api.lanyun.net',
|
||||
models: SYSTEM_MODELS.lanyun,
|
||||
isSystem: true,
|
||||
enabled: false
|
||||
},
|
||||
ph8: {
|
||||
id: 'ph8',
|
||||
name: 'PH8',
|
||||
type: 'openai',
|
||||
apiKey: '',
|
||||
apiHost: 'https://ph8.co',
|
||||
models: SYSTEM_MODELS.ph8,
|
||||
isSystem: true,
|
||||
enabled: false
|
||||
},
|
||||
openrouter: {
|
||||
id: 'openrouter',
|
||||
name: 'OpenRouter',
|
||||
type: 'openai',
|
||||
apiKey: '',
|
||||
apiHost: 'https://openrouter.ai/api/v1/',
|
||||
models: SYSTEM_MODELS.openrouter,
|
||||
isSystem: true,
|
||||
enabled: false
|
||||
},
|
||||
ollama: {
|
||||
id: 'ollama',
|
||||
name: 'Ollama',
|
||||
type: 'openai',
|
||||
apiKey: '',
|
||||
apiHost: 'http://localhost:11434',
|
||||
models: SYSTEM_MODELS.ollama,
|
||||
isSystem: true,
|
||||
enabled: false
|
||||
},
|
||||
'new-api': {
|
||||
id: 'new-api',
|
||||
name: 'New API',
|
||||
type: 'openai',
|
||||
apiKey: '',
|
||||
apiHost: 'http://localhost:3000',
|
||||
models: SYSTEM_MODELS['new-api'],
|
||||
isSystem: true,
|
||||
enabled: false
|
||||
},
|
||||
lmstudio: {
|
||||
id: 'lmstudio',
|
||||
name: 'LM Studio',
|
||||
type: 'openai',
|
||||
apiKey: '',
|
||||
apiHost: 'http://localhost:1234',
|
||||
models: SYSTEM_MODELS.lmstudio,
|
||||
isSystem: true,
|
||||
enabled: false
|
||||
},
|
||||
anthropic: {
|
||||
id: 'anthropic',
|
||||
name: 'Anthropic',
|
||||
type: 'anthropic',
|
||||
apiKey: '',
|
||||
apiHost: 'https://api.anthropic.com/',
|
||||
models: SYSTEM_MODELS.anthropic,
|
||||
isSystem: true,
|
||||
enabled: false
|
||||
},
|
||||
openai: {
|
||||
id: 'openai',
|
||||
name: 'OpenAI',
|
||||
type: 'openai-response',
|
||||
apiKey: '',
|
||||
apiHost: 'https://api.openai.com',
|
||||
models: SYSTEM_MODELS.openai,
|
||||
isSystem: true,
|
||||
enabled: false,
|
||||
isSupportServiceTier: true,
|
||||
serviceTier: OpenAIServiceTiers.AUTO
|
||||
},
|
||||
'azure-openai': {
|
||||
id: 'azure-openai',
|
||||
name: 'Azure OpenAI',
|
||||
type: 'azure-openai',
|
||||
apiKey: '',
|
||||
apiHost: '',
|
||||
apiVersion: '',
|
||||
models: SYSTEM_MODELS['azure-openai'],
|
||||
isSystem: true,
|
||||
enabled: false
|
||||
},
|
||||
gemini: {
|
||||
id: 'gemini',
|
||||
name: 'Gemini',
|
||||
type: 'gemini',
|
||||
apiKey: '',
|
||||
apiHost: 'https://generativelanguage.googleapis.com',
|
||||
models: SYSTEM_MODELS.gemini,
|
||||
isSystem: true,
|
||||
enabled: false,
|
||||
isVertex: false
|
||||
},
|
||||
vertexai: {
|
||||
id: 'vertexai',
|
||||
name: 'VertexAI',
|
||||
type: 'vertexai',
|
||||
apiKey: '',
|
||||
apiHost: 'https://aiplatform.googleapis.com',
|
||||
models: [],
|
||||
isSystem: true,
|
||||
enabled: false,
|
||||
isVertex: true
|
||||
},
|
||||
github: {
|
||||
id: 'github',
|
||||
name: 'Github Models',
|
||||
type: 'openai',
|
||||
apiKey: '',
|
||||
apiHost: 'https://models.inference.ai.azure.com/',
|
||||
models: SYSTEM_MODELS.github,
|
||||
isSystem: true,
|
||||
enabled: false
|
||||
},
|
||||
copilot: {
|
||||
id: 'copilot',
|
||||
name: 'Github Copilot',
|
||||
type: 'openai',
|
||||
apiKey: '',
|
||||
apiHost: 'https://api.githubcopilot.com/',
|
||||
models: SYSTEM_MODELS.copilot,
|
||||
isSystem: true,
|
||||
enabled: false,
|
||||
isAuthed: false
|
||||
},
|
||||
zhipu: {
|
||||
id: 'zhipu',
|
||||
name: 'ZhiPu',
|
||||
type: 'openai',
|
||||
apiKey: '',
|
||||
apiHost: 'https://open.bigmodel.cn/api/paas/v4/',
|
||||
models: SYSTEM_MODELS.zhipu,
|
||||
isSystem: true,
|
||||
enabled: false
|
||||
},
|
||||
yi: {
|
||||
id: 'yi',
|
||||
name: 'Yi',
|
||||
type: 'openai',
|
||||
apiKey: '',
|
||||
apiHost: 'https://api.lingyiwanwu.com',
|
||||
models: SYSTEM_MODELS.yi,
|
||||
isSystem: true,
|
||||
enabled: false
|
||||
},
|
||||
moonshot: {
|
||||
id: 'moonshot',
|
||||
name: 'Moonshot AI',
|
||||
type: 'openai',
|
||||
apiKey: '',
|
||||
apiHost: 'https://api.moonshot.cn',
|
||||
models: SYSTEM_MODELS.moonshot,
|
||||
isSystem: true,
|
||||
enabled: false
|
||||
},
|
||||
baichuan: {
|
||||
id: 'baichuan',
|
||||
name: 'BAICHUAN AI',
|
||||
type: 'openai',
|
||||
apiKey: '',
|
||||
apiHost: 'https://api.baichuan-ai.com',
|
||||
models: SYSTEM_MODELS.baichuan,
|
||||
isSystem: true,
|
||||
enabled: false,
|
||||
isNotSupportArrayContent: true
|
||||
},
|
||||
dashscope: {
|
||||
id: 'dashscope',
|
||||
name: 'Bailian',
|
||||
type: 'openai',
|
||||
apiKey: '',
|
||||
apiHost: 'https://dashscope.aliyuncs.com/compatible-mode/v1/',
|
||||
models: SYSTEM_MODELS.bailian,
|
||||
isSystem: true,
|
||||
enabled: false
|
||||
},
|
||||
stepfun: {
|
||||
id: 'stepfun',
|
||||
name: 'StepFun',
|
||||
type: 'openai',
|
||||
apiKey: '',
|
||||
apiHost: 'https://api.stepfun.com',
|
||||
models: SYSTEM_MODELS.stepfun,
|
||||
isSystem: true,
|
||||
enabled: false
|
||||
},
|
||||
doubao: {
|
||||
id: 'doubao',
|
||||
name: 'doubao',
|
||||
type: 'openai',
|
||||
apiKey: '',
|
||||
apiHost: 'https://ark.cn-beijing.volces.com/api/v3/',
|
||||
models: SYSTEM_MODELS.doubao,
|
||||
isSystem: true,
|
||||
enabled: false
|
||||
},
|
||||
infini: {
|
||||
id: 'infini',
|
||||
name: 'Infini',
|
||||
type: 'openai',
|
||||
apiKey: '',
|
||||
apiHost: 'https://cloud.infini-ai.com/maas',
|
||||
models: SYSTEM_MODELS.infini,
|
||||
isSystem: true,
|
||||
enabled: false
|
||||
},
|
||||
minimax: {
|
||||
id: 'minimax',
|
||||
name: 'MiniMax',
|
||||
type: 'openai',
|
||||
apiKey: '',
|
||||
apiHost: 'https://api.minimax.chat/v1/',
|
||||
models: SYSTEM_MODELS.minimax,
|
||||
isSystem: true,
|
||||
enabled: false,
|
||||
isNotSupportArrayContent: true
|
||||
},
|
||||
groq: {
|
||||
id: 'groq',
|
||||
name: 'Groq',
|
||||
type: 'openai',
|
||||
apiKey: '',
|
||||
apiHost: 'https://api.groq.com/openai',
|
||||
models: SYSTEM_MODELS.groq,
|
||||
isSystem: true,
|
||||
enabled: false,
|
||||
isSupportServiceTier: true,
|
||||
serviceTier: OpenAIServiceTiers.DEFAULT
|
||||
},
|
||||
together: {
|
||||
id: 'together',
|
||||
name: 'Together',
|
||||
type: 'openai',
|
||||
apiKey: '',
|
||||
apiHost: 'https://api.together.xyz',
|
||||
models: SYSTEM_MODELS.together,
|
||||
isSystem: true,
|
||||
enabled: false
|
||||
},
|
||||
fireworks: {
|
||||
id: 'fireworks',
|
||||
name: 'Fireworks',
|
||||
type: 'openai',
|
||||
apiKey: '',
|
||||
apiHost: 'https://api.fireworks.ai/inference',
|
||||
models: SYSTEM_MODELS.fireworks,
|
||||
isSystem: true,
|
||||
enabled: false
|
||||
},
|
||||
nvidia: {
|
||||
id: 'nvidia',
|
||||
name: 'nvidia',
|
||||
type: 'openai',
|
||||
apiKey: '',
|
||||
apiHost: 'https://integrate.api.nvidia.com',
|
||||
models: SYSTEM_MODELS.nvidia,
|
||||
isSystem: true,
|
||||
enabled: false
|
||||
},
|
||||
grok: {
|
||||
id: 'grok',
|
||||
name: 'Grok',
|
||||
type: 'openai',
|
||||
apiKey: '',
|
||||
apiHost: 'https://api.x.ai',
|
||||
models: SYSTEM_MODELS.grok,
|
||||
isSystem: true,
|
||||
enabled: false
|
||||
},
|
||||
hyperbolic: {
|
||||
id: 'hyperbolic',
|
||||
name: 'Hyperbolic',
|
||||
type: 'openai',
|
||||
apiKey: '',
|
||||
apiHost: 'https://api.hyperbolic.xyz',
|
||||
models: SYSTEM_MODELS.hyperbolic,
|
||||
isSystem: true,
|
||||
enabled: false
|
||||
},
|
||||
mistral: {
|
||||
id: 'mistral',
|
||||
name: 'Mistral',
|
||||
type: 'openai',
|
||||
apiKey: '',
|
||||
apiHost: 'https://api.mistral.ai',
|
||||
models: SYSTEM_MODELS.mistral,
|
||||
isSystem: true,
|
||||
enabled: false,
|
||||
isNotSupportStreamOptions: true
|
||||
},
|
||||
jina: {
|
||||
id: 'jina',
|
||||
name: 'Jina',
|
||||
type: 'openai',
|
||||
apiKey: '',
|
||||
apiHost: 'https://api.jina.ai',
|
||||
models: SYSTEM_MODELS.jina,
|
||||
isSystem: true,
|
||||
enabled: false
|
||||
},
|
||||
perplexity: {
|
||||
id: 'perplexity',
|
||||
name: 'Perplexity',
|
||||
type: 'openai',
|
||||
apiKey: '',
|
||||
apiHost: 'https://api.perplexity.ai/',
|
||||
models: SYSTEM_MODELS.perplexity,
|
||||
isSystem: true,
|
||||
enabled: false
|
||||
},
|
||||
modelscope: {
|
||||
id: 'modelscope',
|
||||
name: 'ModelScope',
|
||||
type: 'openai',
|
||||
apiKey: '',
|
||||
apiHost: 'https://api-inference.modelscope.cn/v1/',
|
||||
models: SYSTEM_MODELS.modelscope,
|
||||
isSystem: true,
|
||||
enabled: false
|
||||
},
|
||||
xirang: {
|
||||
id: 'xirang',
|
||||
name: 'Xirang',
|
||||
type: 'openai',
|
||||
apiKey: '',
|
||||
apiHost: 'https://wishub-x1.ctyun.cn',
|
||||
models: SYSTEM_MODELS.xirang,
|
||||
isSystem: true,
|
||||
enabled: false,
|
||||
isNotSupportArrayContent: true
|
||||
},
|
||||
hunyuan: {
|
||||
id: 'hunyuan',
|
||||
name: 'hunyuan',
|
||||
type: 'openai',
|
||||
apiKey: '',
|
||||
apiHost: 'https://api.hunyuan.cloud.tencent.com',
|
||||
models: SYSTEM_MODELS.hunyuan,
|
||||
isSystem: true,
|
||||
enabled: false
|
||||
},
|
||||
'tencent-cloud-ti': {
|
||||
id: 'tencent-cloud-ti',
|
||||
name: 'Tencent Cloud TI',
|
||||
type: 'openai',
|
||||
apiKey: '',
|
||||
apiHost: 'https://api.lkeap.cloud.tencent.com',
|
||||
models: SYSTEM_MODELS['tencent-cloud-ti'],
|
||||
isSystem: true,
|
||||
enabled: false
|
||||
},
|
||||
'baidu-cloud': {
|
||||
id: 'baidu-cloud',
|
||||
name: 'Baidu Cloud',
|
||||
type: 'openai',
|
||||
apiKey: '',
|
||||
apiHost: 'https://qianfan.baidubce.com/v2/',
|
||||
models: SYSTEM_MODELS['baidu-cloud'],
|
||||
isSystem: true,
|
||||
enabled: false
|
||||
},
|
||||
gpustack: {
|
||||
id: 'gpustack',
|
||||
name: 'GPUStack',
|
||||
type: 'openai',
|
||||
apiKey: '',
|
||||
apiHost: '',
|
||||
models: SYSTEM_MODELS.gpustack,
|
||||
isSystem: true,
|
||||
enabled: false
|
||||
},
|
||||
voyageai: {
|
||||
id: 'voyageai',
|
||||
name: 'VoyageAI',
|
||||
type: 'openai',
|
||||
apiKey: '',
|
||||
apiHost: 'https://api.voyageai.com',
|
||||
models: SYSTEM_MODELS.voyageai,
|
||||
isSystem: true,
|
||||
enabled: false
|
||||
},
|
||||
'aws-bedrock': {
|
||||
id: 'aws-bedrock',
|
||||
name: 'AWS Bedrock',
|
||||
type: 'aws-bedrock',
|
||||
apiKey: '',
|
||||
apiHost: '',
|
||||
models: SYSTEM_MODELS['aws-bedrock'],
|
||||
isSystem: true,
|
||||
enabled: false
|
||||
},
|
||||
poe: {
|
||||
id: 'poe',
|
||||
name: 'Poe',
|
||||
type: 'openai',
|
||||
apiKey: '',
|
||||
apiHost: 'https://api.poe.com/v1/',
|
||||
models: SYSTEM_MODELS['poe'],
|
||||
isSystem: true,
|
||||
enabled: false,
|
||||
isNotSupportDeveloperRole: true
|
||||
}
|
||||
} satisfies Record<SystemProviderId, SystemProvider>
|
||||
|
||||
export const SYSTEM_PROVIDERS: SystemProvider[] = Object.values(SYSTEM_PROVIDERS_CONFIG)
|
||||
|
||||
export const initialState: LlmState = {
|
||||
defaultModel: SYSTEM_MODELS.defaultModel[0],
|
||||
topicNamingModel: SYSTEM_MODELS.defaultModel[1],
|
||||
|
||||
@ -7,7 +7,8 @@ import { TRANSLATE_PROMPT } from '@renderer/config/prompts'
|
||||
import {
|
||||
isSupportArrayContentProvider,
|
||||
isSupportDeveloperRoleProvider,
|
||||
isSupportStreamOptionsProvider
|
||||
isSupportStreamOptionsProvider,
|
||||
SYSTEM_PROVIDERS
|
||||
} from '@renderer/config/providers'
|
||||
import db from '@renderer/databases'
|
||||
import i18n from '@renderer/i18n'
|
||||
@ -28,7 +29,7 @@ import { createMigrate } from 'redux-persist'
|
||||
|
||||
import { RootState } from '.'
|
||||
import { DEFAULT_TOOL_ORDER } from './inputTools'
|
||||
import { initialState as llmInitialState, moveProvider, SYSTEM_PROVIDERS } from './llm'
|
||||
import { initialState as llmInitialState, moveProvider } from './llm'
|
||||
import { mcpSlice } from './mcp'
|
||||
import { defaultActionItems } from './selectionStore'
|
||||
import { DEFAULT_SIDEBAR_ICONS, initialState as settingsInitialState } from './settings'
|
||||
|
||||
Loading…
Reference in New Issue
Block a user