Skip to content

Commit 6b9f20f

Browse files
committed
🐛 fix: chat info error
1 parent cc33621 commit 6b9f20f

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/store/agent/index.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,19 @@ import { shallow } from 'zustand/shallow';
1313
import { createWithEqualityFn } from 'zustand/traditional';
1414
import { StateCreator } from 'zustand/vanilla';
1515

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';
1721
import { DEFAULT_AGENT_AVATAR_URL } from '@/constants/common';
1822
import { DEFAULT_TTS_CONFIG_FEMALE, DEFAULT_TTS_CONFIG_MALE } from '@/constants/tts';
1923
import createTouchStore from '@/store/agent/slices/touch';
2024
import { Agent, AgentMeta, CategoryEnum, GenderEnum } from '@/types/agent';
2125
import { TTS } from '@/types/tts';
2226
import { mergeWithUndefined } from '@/utils/common';
2327
import { getModelPathByAgentId } from '@/utils/file';
28+
import { merge } from '@/utils/merge';
2429
import storage from '@/utils/storage';
2530

2631
import { initialState } from './initialState';
@@ -130,7 +135,7 @@ const createAgentStore: StateCreator<AgentStore, [['zustand/devtools', never]]>
130135
const currentAgent = localAgentList.find((item) => item.agentId === agentId);
131136
if (!currentAgent) return undefined;
132137

133-
return currentAgent;
138+
return merge(DEFAULT_AGENT_CONFIG, currentAgent);
134139
},
135140
createNewAgent: (gender) => {
136141
const { localAgentList } = get();

0 commit comments

Comments
 (0)