@@ -13,14 +13,19 @@ import { shallow } from 'zustand/shallow';
13
13
import { createWithEqualityFn } from 'zustand/traditional' ;
14
14
import { StateCreator } from 'zustand/vanilla' ;
15
15
16
- import { DEFAULT_LLM_CONFIG , LOBE_VIDOL_DEFAULT_AGENT_ID } from '@/constants/agent' ;
16
+ import {
17
+ DEFAULT_AGENT_CONFIG ,
18
+ DEFAULT_LLM_CONFIG ,
19
+ LOBE_VIDOL_DEFAULT_AGENT_ID ,
20
+ } from '@/constants/agent' ;
17
21
import { DEFAULT_AGENT_AVATAR_URL } from '@/constants/common' ;
18
22
import { DEFAULT_TTS_CONFIG_FEMALE , DEFAULT_TTS_CONFIG_MALE } from '@/constants/tts' ;
19
23
import createTouchStore from '@/store/agent/slices/touch' ;
20
24
import { Agent , AgentMeta , CategoryEnum , GenderEnum } from '@/types/agent' ;
21
25
import { TTS } from '@/types/tts' ;
22
26
import { mergeWithUndefined } from '@/utils/common' ;
23
27
import { getModelPathByAgentId } from '@/utils/file' ;
28
+ import { merge } from '@/utils/merge' ;
24
29
import storage from '@/utils/storage' ;
25
30
26
31
import { initialState } from './initialState' ;
@@ -130,7 +135,7 @@ const createAgentStore: StateCreator<AgentStore, [['zustand/devtools', never]]>
130
135
const currentAgent = localAgentList . find ( ( item ) => item . agentId === agentId ) ;
131
136
if ( ! currentAgent ) return undefined ;
132
137
133
- return currentAgent ;
138
+ return merge ( DEFAULT_AGENT_CONFIG , currentAgent ) ;
134
139
} ,
135
140
createNewAgent : ( gender ) => {
136
141
const { localAgentList } = get ( ) ;
0 commit comments