mirror of
https://github.com/NanmiCoder/cc-haha
synced 2026-07-16 13:03:31 +08:00
feat: add provider preset definitions (Official, DeepSeek, ZhipuGLM, Kimi, MiniMax, Custom)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
468a2853e0
commit
08cd15ed1b
69
desktop/src/config/providerPresets.ts
Normal file
69
desktop/src/config/providerPresets.ts
Normal file
@ -0,0 +1,69 @@
|
||||
// Provider presets inspired by cc-switch (https://github.com/farion1231/cc-switch)
|
||||
// Original work by Jason Young, MIT License
|
||||
|
||||
export type ModelMapping = {
|
||||
main: string
|
||||
haiku: string
|
||||
sonnet: string
|
||||
opus: string
|
||||
}
|
||||
|
||||
export type ProviderPreset = {
|
||||
id: string
|
||||
name: string
|
||||
baseUrl: string
|
||||
defaultModels: ModelMapping
|
||||
needsApiKey: boolean
|
||||
websiteUrl: string
|
||||
}
|
||||
|
||||
export const PROVIDER_PRESETS: ProviderPreset[] = [
|
||||
{
|
||||
id: 'official',
|
||||
name: 'Claude Official',
|
||||
baseUrl: '',
|
||||
defaultModels: { main: '', haiku: '', sonnet: '', opus: '' },
|
||||
needsApiKey: false,
|
||||
websiteUrl: 'https://www.anthropic.com/claude-code',
|
||||
},
|
||||
{
|
||||
id: 'deepseek',
|
||||
name: 'DeepSeek',
|
||||
baseUrl: 'https://api.deepseek.com/anthropic',
|
||||
defaultModels: { main: 'DeepSeek-V3.2', haiku: 'DeepSeek-V3.2', sonnet: 'DeepSeek-V3.2', opus: 'DeepSeek-V3.2' },
|
||||
needsApiKey: true,
|
||||
websiteUrl: 'https://platform.deepseek.com',
|
||||
},
|
||||
{
|
||||
id: 'zhipuglm',
|
||||
name: 'Zhipu GLM',
|
||||
baseUrl: 'https://open.bigmodel.cn/api/anthropic',
|
||||
defaultModels: { main: 'glm-5', haiku: 'glm-5', sonnet: 'glm-5', opus: 'glm-5' },
|
||||
needsApiKey: true,
|
||||
websiteUrl: 'https://open.bigmodel.cn',
|
||||
},
|
||||
{
|
||||
id: 'kimi',
|
||||
name: 'Kimi',
|
||||
baseUrl: 'https://api.moonshot.cn/anthropic',
|
||||
defaultModels: { main: 'kimi-k2.5', haiku: 'kimi-k2.5', sonnet: 'kimi-k2.5', opus: 'kimi-k2.5' },
|
||||
needsApiKey: true,
|
||||
websiteUrl: 'https://platform.moonshot.cn',
|
||||
},
|
||||
{
|
||||
id: 'minimax',
|
||||
name: 'MiniMax',
|
||||
baseUrl: 'https://api.minimaxi.com/anthropic',
|
||||
defaultModels: { main: 'MiniMax-M2.7', haiku: 'MiniMax-M2.7', sonnet: 'MiniMax-M2.7', opus: 'MiniMax-M2.7' },
|
||||
needsApiKey: true,
|
||||
websiteUrl: 'https://platform.minimaxi.com',
|
||||
},
|
||||
{
|
||||
id: 'custom',
|
||||
name: 'Custom',
|
||||
baseUrl: '',
|
||||
defaultModels: { main: '', haiku: '', sonnet: '', opus: '' },
|
||||
needsApiKey: true,
|
||||
websiteUrl: '',
|
||||
},
|
||||
]
|
||||
69
src/server/config/providerPresets.ts
Normal file
69
src/server/config/providerPresets.ts
Normal file
@ -0,0 +1,69 @@
|
||||
// Provider presets inspired by cc-switch (https://github.com/farion1231/cc-switch)
|
||||
// Original work by Jason Young, MIT License
|
||||
|
||||
export type ModelMapping = {
|
||||
main: string
|
||||
haiku: string
|
||||
sonnet: string
|
||||
opus: string
|
||||
}
|
||||
|
||||
export type ProviderPreset = {
|
||||
id: string
|
||||
name: string
|
||||
baseUrl: string
|
||||
defaultModels: ModelMapping
|
||||
needsApiKey: boolean
|
||||
websiteUrl: string
|
||||
}
|
||||
|
||||
export const PROVIDER_PRESETS: ProviderPreset[] = [
|
||||
{
|
||||
id: 'official',
|
||||
name: 'Claude Official',
|
||||
baseUrl: '',
|
||||
defaultModels: { main: '', haiku: '', sonnet: '', opus: '' },
|
||||
needsApiKey: false,
|
||||
websiteUrl: 'https://www.anthropic.com/claude-code',
|
||||
},
|
||||
{
|
||||
id: 'deepseek',
|
||||
name: 'DeepSeek',
|
||||
baseUrl: 'https://api.deepseek.com/anthropic',
|
||||
defaultModels: { main: 'DeepSeek-V3.2', haiku: 'DeepSeek-V3.2', sonnet: 'DeepSeek-V3.2', opus: 'DeepSeek-V3.2' },
|
||||
needsApiKey: true,
|
||||
websiteUrl: 'https://platform.deepseek.com',
|
||||
},
|
||||
{
|
||||
id: 'zhipuglm',
|
||||
name: 'Zhipu GLM',
|
||||
baseUrl: 'https://open.bigmodel.cn/api/anthropic',
|
||||
defaultModels: { main: 'glm-5', haiku: 'glm-5', sonnet: 'glm-5', opus: 'glm-5' },
|
||||
needsApiKey: true,
|
||||
websiteUrl: 'https://open.bigmodel.cn',
|
||||
},
|
||||
{
|
||||
id: 'kimi',
|
||||
name: 'Kimi',
|
||||
baseUrl: 'https://api.moonshot.cn/anthropic',
|
||||
defaultModels: { main: 'kimi-k2.5', haiku: 'kimi-k2.5', sonnet: 'kimi-k2.5', opus: 'kimi-k2.5' },
|
||||
needsApiKey: true,
|
||||
websiteUrl: 'https://platform.moonshot.cn',
|
||||
},
|
||||
{
|
||||
id: 'minimax',
|
||||
name: 'MiniMax',
|
||||
baseUrl: 'https://api.minimaxi.com/anthropic',
|
||||
defaultModels: { main: 'MiniMax-M2.7', haiku: 'MiniMax-M2.7', sonnet: 'MiniMax-M2.7', opus: 'MiniMax-M2.7' },
|
||||
needsApiKey: true,
|
||||
websiteUrl: 'https://platform.minimaxi.com',
|
||||
},
|
||||
{
|
||||
id: 'custom',
|
||||
name: 'Custom',
|
||||
baseUrl: '',
|
||||
defaultModels: { main: '', haiku: '', sonnet: '', opus: '' },
|
||||
needsApiKey: true,
|
||||
websiteUrl: '',
|
||||
},
|
||||
]
|
||||
Loading…
x
Reference in New Issue
Block a user