diff --git a/src/renderer/src/store/index.ts b/src/renderer/src/store/index.ts index 81b547eed1..ae5c52a9fb 100644 --- a/src/renderer/src/store/index.ts +++ b/src/renderer/src/store/index.ts @@ -50,7 +50,7 @@ const persistedReducer = persistReducer( { key: 'cherry-studio', storage, - version: 114, + version: 115, blacklist: ['runtime', 'messages', 'messageBlocks'], migrate }, diff --git a/src/renderer/src/store/migrate.ts b/src/renderer/src/store/migrate.ts index ece6204f66..df89be66b8 100644 --- a/src/renderer/src/store/migrate.ts +++ b/src/renderer/src/store/migrate.ts @@ -1,5 +1,5 @@ import { nanoid } from '@reduxjs/toolkit' -import { isMac } from '@renderer/config/constant' +import { DEFAULT_CONTEXTCOUNT, DEFAULT_TEMPERATURE, isMac } from '@renderer/config/constant' import { DEFAULT_MIN_APPS } from '@renderer/config/minapps' import { SYSTEM_MODELS } from '@renderer/config/models' import { TRANSLATE_PROMPT } from '@renderer/config/prompts' @@ -1611,6 +1611,26 @@ const migrateConfig = { } catch (error) { return state } + }, + '115': (state: RootState) => { + try { + state.assistants.assistants.forEach((assistant) => { + if (!assistant.settings) { + assistant.settings = { + temperature: DEFAULT_TEMPERATURE, + contextCount: DEFAULT_CONTEXTCOUNT, + topP: 1, + toolUseMode: 'prompt', + customParameters: [], + streamOutput: true, + enableMaxTokens: false + } + } + }) + return state + } catch (error) { + return state + } } }