chore: update store migration and LLM providers

This commit is contained in:
kangfenmao 2025-02-12 14:52:45 +08:00
parent 1b3ae92854
commit 635e125ef4
3 changed files with 47 additions and 31 deletions

View File

@ -30,7 +30,7 @@ const persistedReducer = persistReducer(
{
key: 'cherry-studio',
storage,
version: 65,
version: 66,
blacklist: ['runtime'],
migrate
},

View File

@ -43,16 +43,6 @@ const initialState: LlmState = {
isSystem: true,
enabled: false
},
{
id: 'gitee-ai',
name: 'gitee ai',
type: 'openai',
apiKey: '',
apiHost: 'https://ai.gitee.com',
models: SYSTEM_MODELS['gitee-ai'],
isSystem: true,
enabled: false
},
{
id: 'deepseek',
name: 'deepseek',
@ -63,16 +53,6 @@ const initialState: LlmState = {
isSystem: true,
enabled: false
},
{
id: 'ppio',
name: 'PPIO',
type: 'openai',
apiKey: '',
apiHost: 'https://api.ppinfra.com/v3/openai',
models: SYSTEM_MODELS.ppio,
isSystem: true,
enabled: false
},
{
id: 'ocoolai',
name: 'ocoolAI',
@ -234,16 +214,6 @@ const initialState: LlmState = {
isSystem: true,
enabled: false
},
{
id: 'graphrag-kylin-mountain',
name: 'GraphRAG',
type: 'openai',
apiKey: '',
apiHost: '',
models: [],
isSystem: true,
enabled: false
},
{
id: 'openrouter',
name: 'OpenRouter',
@ -353,6 +323,26 @@ const initialState: LlmState = {
models: SYSTEM_MODELS.jina,
isSystem: true,
enabled: false
},
{
id: 'gitee-ai',
name: 'gitee ai',
type: 'openai',
apiKey: '',
apiHost: 'https://ai.gitee.com',
models: SYSTEM_MODELS['gitee-ai'],
isSystem: true,
enabled: false
},
{
id: 'ppio',
name: 'PPIO',
type: 'openai',
apiKey: '',
apiHost: 'https://api.ppinfra.com/v3/openai',
models: SYSTEM_MODELS.ppio,
isSystem: true,
enabled: false
}
],
settings: {

View File

@ -925,6 +925,32 @@ const migrateConfig = {
'65': (state: RootState) => {
state.settings.targetLanguage = 'english'
return state
},
'66': (state: RootState) => {
state.llm.providers.push(
{
id: 'gitee-ai',
name: 'gitee ai',
type: 'openai',
apiKey: '',
apiHost: 'https://ai.gitee.com',
models: SYSTEM_MODELS['gitee-ai'],
isSystem: true,
enabled: false
},
{
id: 'ppio',
name: 'PPIO',
type: 'openai',
apiKey: '',
apiHost: 'https://api.ppinfra.com/v3/openai',
models: SYSTEM_MODELS.ppio,
isSystem: true,
enabled: false
}
)
state.llm.providers = state.llm.providers.filter((provider) => provider.id !== 'graphrag-kylin-mountain')
return state
}
}