@lobehub/chat 0.115.2 → 0.115.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +50 -0
- package/package.json +1 -1
- package/src/app/chat/features/SessionListContent/DefaultMode.tsx +2 -1
- package/src/app/chat/features/SessionListContent/List/Item/index.tsx +2 -1
- package/src/app/settings/agent/Agent.tsx +2 -1
- package/src/app/settings/common/Common.tsx +2 -1
- package/src/app/settings/llm/LLM/Checker.tsx +1 -1
- package/src/app/settings/llm/LLM/index.tsx +2 -1
- package/src/app/settings/tts/TTS/index.tsx +2 -1
- package/src/database/models/__tests__/message.test.ts +1 -1
- package/src/database/models/message.ts +1 -1
- package/src/features/AgentSetting/AgentConfig/index.tsx +2 -1
- package/src/features/AgentSetting/AgentMeta/index.tsx +2 -1
- package/src/features/AgentSetting/AgentTTS/SelectWithTTSPreview.tsx +1 -1
- package/src/features/AgentSetting/AgentTTS/index.tsx +3 -2
- package/src/features/ChatInput/ActionBar/ModelSwitch.tsx +2 -1
- package/src/features/ChatInput/STT/index.tsx +1 -1
- package/src/features/Conversation/ChatList/Error/ApiKeyForm.tsx +2 -1
- package/src/features/Conversation/ChatList/Extras/Assistant.test.tsx +1 -1
- package/src/features/Conversation/ChatList/Extras/Assistant.tsx +1 -1
- package/src/features/Conversation/ChatList/Extras/TTS/InitPlayer.tsx +1 -1
- package/src/features/Conversation/ChatList/Extras/TTS/Player.tsx +1 -1
- package/src/features/Conversation/ChatList/Extras/TTS/index.tsx +3 -2
- package/src/features/Conversation/ChatList/Extras/Translate.tsx +1 -1
- package/src/features/Conversation/ChatList/Extras/User.tsx +1 -1
- package/src/features/Conversation/ChatList/Extras/type.ts +1 -1
- package/src/features/Conversation/ChatList/Messages/Assistant.tsx +1 -1
- package/src/features/Conversation/ChatList/Messages/Default.tsx +1 -1
- package/src/features/Conversation/ChatList/Messages/Function.tsx +1 -1
- package/src/features/Conversation/ChatList/Messages/User.tsx +1 -1
- package/src/features/Conversation/index.tsx +2 -1
- package/src/features/PluginDevModal/LocalForm.tsx +3 -2
- package/src/hooks/useSTT.ts +2 -1
- package/src/hooks/useTTS.ts +2 -1
- package/src/services/__tests__/chat.test.ts +1 -1
- package/src/services/__tests__/message.test.ts +1 -1
- package/src/services/_header.ts +2 -2
- package/src/services/chat.ts +1 -1
- package/src/services/config.ts +3 -2
- package/src/services/message.ts +2 -2
- package/src/store/chat/helpers.test.ts +1 -1
- package/src/store/chat/helpers.ts +1 -1
- package/src/store/chat/initialState.ts +9 -47
- package/src/store/chat/selectors.ts +3 -0
- package/src/store/chat/{actions/enhance.test.ts → slices/enchance/action.test.ts} +2 -2
- package/src/store/chat/{actions/message.test.ts → slices/message/action.test.ts} +2 -2
- package/src/store/chat/{actions/message.ts → slices/message/action.ts} +3 -3
- package/src/store/chat/slices/message/initialState.ts +29 -0
- package/src/store/chat/{reducers/message.test.ts → slices/message/reducer.test.ts} +2 -2
- package/src/store/chat/{reducers/message.ts → slices/message/reducer.ts} +1 -1
- package/src/store/chat/{selectors/__tests__/chat.test.ts → slices/message/selectors.test.ts} +2 -2
- package/src/store/chat/{selectors/chat.ts → slices/message/selectors.ts} +3 -3
- package/src/store/chat/{actions/share.ts → slices/share/action.ts} +2 -2
- package/src/store/chat/slices/share/initialState.ts +7 -0
- package/src/store/chat/{actions/plugin.ts → slices/tool/action.ts} +2 -4
- package/src/store/chat/slices/tool/initialState.ts +7 -0
- package/src/store/chat/{actions/topic.test.ts → slices/topic/action.test.ts} +2 -2
- package/src/store/chat/{actions/topic.ts → slices/topic/action.ts} +3 -2
- package/src/store/chat/slices/topic/initialState.ts +23 -0
- package/src/store/chat/{selectors/__tests__/topic.test.ts → slices/topic/selectors.test.ts} +1 -1
- package/src/store/chat/{selectors/topic.ts → slices/topic/selectors.ts} +1 -1
- package/src/store/chat/store.ts +5 -5
- package/src/store/global/helpers.ts +1 -1
- package/src/store/global/index.ts +0 -1
- package/src/store/global/initialState.ts +6 -61
- package/src/store/global/selectors.ts +2 -2
- package/src/store/global/slices/{common.ts → common/action.ts} +3 -3
- package/src/store/global/slices/common/initialState.ts +55 -0
- package/src/store/global/{selectors/preference.ts → slices/common/selectors.ts} +1 -1
- package/src/store/global/slices/{settings.ts → settings/action.ts} +12 -4
- package/src/store/global/slices/settings/initialState.ts +15 -0
- package/src/store/global/{selectors/settings.test.ts → slices/settings/selectors.test.ts} +2 -2
- package/src/store/global/{selectors/settings.ts → slices/settings/selectors.ts} +3 -4
- package/src/store/global/store.ts +4 -18
- package/src/store/session/slices/agent/selectors.ts +2 -1
- package/src/store/session/slices/session/action.ts +2 -1
- package/src/tools/dalle/Render/ToolBar.tsx +2 -1
- package/src/types/exportConfig.ts +1 -1
- package/src/types/{chatMessage.ts → message/index.ts} +2 -2
- package/src/types/settings.ts +0 -29
- package/src/utils/fetch.ts +1 -1
- package/src/store/chat/selectors/index.ts +0 -3
- package/src/store/global/slices/agent.ts +0 -34
- /package/src/store/chat/{actions/enhance.ts → slices/enchance/action.ts} +0 -0
- /package/src/store/chat/{selectors/enchance.ts → slices/enchance/selectors.ts} +0 -0
- /package/src/store/chat/{actions/plugin.test.ts → slices/tool/action.test.ts} +0 -0
- /package/src/store/global/{selectors/__snapshots__/settings.test.ts.snap → slices/settings/__snapshots__/selectors.test.ts.snap} +0 -0
package/src/types/settings.ts
CHANGED
|
@@ -5,37 +5,8 @@ import { LocaleMode } from '@/types/locale';
|
|
|
5
5
|
import type { LobeAgentSession } from '@/types/session';
|
|
6
6
|
|
|
7
7
|
export interface GlobalBaseSettings {
|
|
8
|
-
/**
|
|
9
|
-
* @deprecated
|
|
10
|
-
*/
|
|
11
|
-
OPENAI_API_KEY?: string;
|
|
12
|
-
|
|
13
8
|
avatar: string;
|
|
14
|
-
/**
|
|
15
|
-
* @deprecated
|
|
16
|
-
*/
|
|
17
|
-
compressThreshold?: number;
|
|
18
|
-
/**
|
|
19
|
-
* @deprecated
|
|
20
|
-
*/
|
|
21
|
-
enableCompressThreshold?: boolean;
|
|
22
|
-
/**
|
|
23
|
-
* @deprecated
|
|
24
|
-
*/
|
|
25
|
-
enableHistoryCount?: boolean;
|
|
26
|
-
/**
|
|
27
|
-
* @deprecated
|
|
28
|
-
*/
|
|
29
|
-
enableMaxTokens?: boolean;
|
|
30
|
-
/**
|
|
31
|
-
* @deprecated
|
|
32
|
-
*/
|
|
33
|
-
endpoint?: string;
|
|
34
9
|
fontSize: number;
|
|
35
|
-
/**
|
|
36
|
-
* @deprecated
|
|
37
|
-
*/
|
|
38
|
-
historyCount?: number;
|
|
39
10
|
language: LocaleMode;
|
|
40
11
|
neutralColor?: NeutralColors;
|
|
41
12
|
password: string;
|
package/src/utils/fetch.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t } from 'i18next';
|
|
2
2
|
|
|
3
|
-
import { ChatMessageError } from '@/types/chatMessage';
|
|
4
3
|
import { ErrorResponse, ErrorType } from '@/types/fetch';
|
|
4
|
+
import { ChatMessageError } from '@/types/message';
|
|
5
5
|
|
|
6
6
|
export const getMessageError = async (response: Response) => {
|
|
7
7
|
let chatMessageError: ChatMessageError;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { produce } from 'immer';
|
|
2
|
-
import { DeepPartial } from 'utility-types';
|
|
3
|
-
import type { StateCreator } from 'zustand/vanilla';
|
|
4
|
-
|
|
5
|
-
import { LobeAgentSettings } from '@/types/session';
|
|
6
|
-
import type { GlobalSettings } from '@/types/settings';
|
|
7
|
-
import { merge } from '@/utils/merge';
|
|
8
|
-
import { setNamespace } from '@/utils/storeDebug';
|
|
9
|
-
|
|
10
|
-
import type { GlobalStore } from '../store';
|
|
11
|
-
|
|
12
|
-
const n = setNamespace('settings');
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* 设置操作
|
|
16
|
-
*/
|
|
17
|
-
export interface AgentAction {
|
|
18
|
-
updateDefaultAgent: (agent: DeepPartial<LobeAgentSettings>) => void;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export const createAgentSlice: StateCreator<
|
|
22
|
-
GlobalStore,
|
|
23
|
-
[['zustand/devtools', never]],
|
|
24
|
-
[],
|
|
25
|
-
AgentAction
|
|
26
|
-
> = (set, get) => ({
|
|
27
|
-
updateDefaultAgent: (agent) => {
|
|
28
|
-
const settings = produce(get().settings, (draft: GlobalSettings) => {
|
|
29
|
-
draft.defaultAgent = merge(draft.defaultAgent, agent);
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
set({ settings }, false, n('updateDefaultAgent', agent));
|
|
33
|
-
},
|
|
34
|
-
});
|
|
File without changes
|
|
File without changes
|
|
File without changes
|