mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-20 15:10:59 +08:00
feat: add LongCat provider support (#10365)
* feat: add LongCat provider support - Add LongCat to SystemProviderIds enum - Add LongCat provider logo and configuration - Configure API endpoints and URLs based on official docs - Add two models: LongCat-Flash-Chat and LongCat-Flash-Thinking - Update provider mappings for proper integration The LongCat provider uses OpenAI-compatible API format and supports up to 8K tokens output with daily free quota of 500K tokens. Signed-off-by: LeaderOnePro <leaderonepro@outlook.com> * feat: add migration for LongCat provider - Add migration version 158 for LongCat provider - Ensure existing users get LongCat provider on app update - Follow standard migration pattern for simple provider additions Signed-off-by: LeaderOnePro <leaderonepro@outlook.com> --------- Signed-off-by: LeaderOnePro <leaderonepro@outlook.com>
This commit is contained in:
parent
06ab2822be
commit
c7d2588f1a
BIN
src/renderer/src/assets/images/providers/longcat.png
Normal file
BIN
src/renderer/src/assets/images/providers/longcat.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.6 KiB |
@ -1804,5 +1804,19 @@ export const SYSTEM_MODELS: Record<SystemProviderId | 'defaultModel', Model[]> =
|
|||||||
provider: 'aionly',
|
provider: 'aionly',
|
||||||
group: 'gemini'
|
group: 'gemini'
|
||||||
}
|
}
|
||||||
|
],
|
||||||
|
longcat: [
|
||||||
|
{
|
||||||
|
id: 'LongCat-Flash-Chat',
|
||||||
|
name: 'LongCat Flash Chat',
|
||||||
|
provider: 'longcat',
|
||||||
|
group: 'LongCat'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'LongCat-Flash-Thinking',
|
||||||
|
name: 'LongCat Flash Thinking',
|
||||||
|
provider: 'longcat',
|
||||||
|
group: 'LongCat'
|
||||||
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@ -27,6 +27,7 @@ import InfiniProviderLogo from '@renderer/assets/images/providers/infini.png'
|
|||||||
import JinaProviderLogo from '@renderer/assets/images/providers/jina.png'
|
import JinaProviderLogo from '@renderer/assets/images/providers/jina.png'
|
||||||
import LanyunProviderLogo from '@renderer/assets/images/providers/lanyun.png'
|
import LanyunProviderLogo from '@renderer/assets/images/providers/lanyun.png'
|
||||||
import LMStudioProviderLogo from '@renderer/assets/images/providers/lmstudio.png'
|
import LMStudioProviderLogo from '@renderer/assets/images/providers/lmstudio.png'
|
||||||
|
import LongCatProviderLogo from '@renderer/assets/images/providers/longcat.png'
|
||||||
import MinimaxProviderLogo from '@renderer/assets/images/providers/minimax.png'
|
import MinimaxProviderLogo from '@renderer/assets/images/providers/minimax.png'
|
||||||
import MistralProviderLogo from '@renderer/assets/images/providers/mistral.png'
|
import MistralProviderLogo from '@renderer/assets/images/providers/mistral.png'
|
||||||
import ModelScopeProviderLogo from '@renderer/assets/images/providers/modelscope.png'
|
import ModelScopeProviderLogo from '@renderer/assets/images/providers/modelscope.png'
|
||||||
@ -622,6 +623,16 @@ export const SYSTEM_PROVIDERS_CONFIG: Record<SystemProviderId, SystemProvider> =
|
|||||||
models: SYSTEM_MODELS['poe'],
|
models: SYSTEM_MODELS['poe'],
|
||||||
isSystem: true,
|
isSystem: true,
|
||||||
enabled: false
|
enabled: false
|
||||||
|
},
|
||||||
|
longcat: {
|
||||||
|
id: 'longcat',
|
||||||
|
name: 'LongCat',
|
||||||
|
type: 'openai',
|
||||||
|
apiKey: '',
|
||||||
|
apiHost: 'https://api.longcat.chat/openai',
|
||||||
|
models: SYSTEM_MODELS.longcat,
|
||||||
|
isSystem: true,
|
||||||
|
enabled: false
|
||||||
}
|
}
|
||||||
} as const
|
} as const
|
||||||
|
|
||||||
@ -684,7 +695,8 @@ export const PROVIDER_LOGO_MAP: AtLeast<SystemProviderId, string> = {
|
|||||||
'new-api': NewAPIProviderLogo,
|
'new-api': NewAPIProviderLogo,
|
||||||
'aws-bedrock': AwsProviderLogo,
|
'aws-bedrock': AwsProviderLogo,
|
||||||
poe: 'poe', // use svg icon component
|
poe: 'poe', // use svg icon component
|
||||||
aionly: AiOnlyProviderLogo
|
aionly: AiOnlyProviderLogo,
|
||||||
|
longcat: LongCatProviderLogo
|
||||||
} as const
|
} as const
|
||||||
|
|
||||||
export function getProviderLogo(providerId: string) {
|
export function getProviderLogo(providerId: string) {
|
||||||
@ -1290,6 +1302,17 @@ export const PROVIDER_URLS: Record<SystemProviderId, ProviderUrls> = {
|
|||||||
docs: 'https://www.aiionly.com/document',
|
docs: 'https://www.aiionly.com/document',
|
||||||
models: 'https://www.aiionly.com'
|
models: 'https://www.aiionly.com'
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
longcat: {
|
||||||
|
api: {
|
||||||
|
url: 'https://api.longcat.chat/openai'
|
||||||
|
},
|
||||||
|
websites: {
|
||||||
|
official: 'https://longcat.chat',
|
||||||
|
apiKey: 'https://longcat.chat/platform/api_keys',
|
||||||
|
docs: 'https://longcat.chat/platform/docs/zh/',
|
||||||
|
models: 'https://longcat.chat/platform/docs/zh/APIDocs.html'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2543,6 +2543,7 @@ const migrateConfig = {
|
|||||||
'158': (state: RootState) => {
|
'158': (state: RootState) => {
|
||||||
try {
|
try {
|
||||||
state.llm.providers = state.llm.providers.filter((provider) => provider.id !== 'cherryin')
|
state.llm.providers = state.llm.providers.filter((provider) => provider.id !== 'cherryin')
|
||||||
|
addProvider(state, 'longcat')
|
||||||
return state
|
return state
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
logger.error('migrate 158 error', error as Error)
|
logger.error('migrate 158 error', error as Error)
|
||||||
|
|||||||
@ -322,7 +322,8 @@ export const SystemProviderIds = {
|
|||||||
voyageai: 'voyageai',
|
voyageai: 'voyageai',
|
||||||
'aws-bedrock': 'aws-bedrock',
|
'aws-bedrock': 'aws-bedrock',
|
||||||
poe: 'poe',
|
poe: 'poe',
|
||||||
aionly: 'aionly'
|
aionly: 'aionly',
|
||||||
|
longcat: 'longcat'
|
||||||
} as const
|
} as const
|
||||||
|
|
||||||
export type SystemProviderId = keyof typeof SystemProviderIds
|
export type SystemProviderId = keyof typeof SystemProviderIds
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user