mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-01-08 22:39:36 +08:00
fix: update ollama provider type and increment store version to 190
- Changed ollama provider type from 'openai' to 'ollama' in SYSTEM_PROVIDERS_CONFIG. - Incremented persisted reducer version from 189 to 190. - Added migration logic for version 190 to update existing provider types in state.
This commit is contained in:
parent
4ae9bf8ff4
commit
0f0e18231d
@ -289,7 +289,7 @@ export const SYSTEM_PROVIDERS_CONFIG: Record<SystemProviderId, SystemProvider> =
|
|||||||
ollama: {
|
ollama: {
|
||||||
id: 'ollama',
|
id: 'ollama',
|
||||||
name: 'Ollama',
|
name: 'Ollama',
|
||||||
type: 'openai',
|
type: 'ollama',
|
||||||
apiKey: '',
|
apiKey: '',
|
||||||
apiHost: 'http://localhost:11434',
|
apiHost: 'http://localhost:11434',
|
||||||
models: SYSTEM_MODELS.ollama,
|
models: SYSTEM_MODELS.ollama,
|
||||||
|
|||||||
@ -67,7 +67,7 @@ const persistedReducer = persistReducer(
|
|||||||
{
|
{
|
||||||
key: 'cherry-studio',
|
key: 'cherry-studio',
|
||||||
storage,
|
storage,
|
||||||
version: 189,
|
version: 190,
|
||||||
blacklist: ['runtime', 'messages', 'messageBlocks', 'tabs', 'toolPermissions'],
|
blacklist: ['runtime', 'messages', 'messageBlocks', 'tabs', 'toolPermissions'],
|
||||||
migrate
|
migrate
|
||||||
},
|
},
|
||||||
|
|||||||
@ -3098,6 +3098,21 @@ const migrateConfig = {
|
|||||||
logger.error('migrate 189 error', error as Error)
|
logger.error('migrate 189 error', error as Error)
|
||||||
return state
|
return state
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
// 1.7.8
|
||||||
|
'190': (state: RootState) => {
|
||||||
|
try {
|
||||||
|
state.llm.providers.forEach((provider) => {
|
||||||
|
if (provider.id === SystemProviderIds.ollama) {
|
||||||
|
provider.type = 'ollama'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
logger.info('migrate 190 success')
|
||||||
|
return state
|
||||||
|
} catch (error) {
|
||||||
|
logger.error('migrate 190 error', error as Error)
|
||||||
|
return state
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user