chore(migration): update version and adjust provider type for QwenLM #833

- Incremented version from 60 to 61 in the persisted reducer configuration.
- Updated migration logic to change the provider type for 'qwenlm' from 'openai' to 'qwenlm', ensuring correct identification in the state management.
This commit is contained in:
kangfenmao 2025-01-23 13:20:15 +08:00
parent e07d4838a9
commit ad9fefe902
2 changed files with 10 additions and 2 deletions

View File

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

View File

@ -814,7 +814,7 @@ const migrateConfig = {
state.llm.providers.push({
id: 'qwenlm',
name: 'QwenLM',
type: 'openai',
type: 'qwenlm',
apiKey: '',
apiHost: 'https://chat.qwenlm.ai/api/',
models: SYSTEM_MODELS.qwenlm,
@ -881,6 +881,14 @@ const migrateConfig = {
'60': (state: RootState) => {
state.settings.multiModelMessageStyle = 'fold'
return state
},
'61': (state: RootState) => {
state.llm.providers.forEach((provider) => {
if (provider.id === 'qwenlm') {
provider.type = 'qwenlm'
}
})
return state
}
}