@lobehub/chat 1.22.3 → 1.22.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 +25 -0
- package/package.json +1 -1
- package/src/features/ChatInput/useSend.ts +1 -1
- package/src/store/chat/initialState.ts +3 -0
- package/src/store/chat/slices/aiChat/action.test.ts +946 -0
- package/src/store/chat/slices/aiChat/action.ts +536 -0
- package/src/store/chat/slices/aiChat/initialState.ts +27 -0
- package/src/store/chat/slices/enchance/action.test.ts +1 -1
- package/src/store/chat/slices/message/action.test.ts +49 -900
- package/src/store/chat/slices/message/action.ts +8 -506
- package/src/store/chat/slices/message/initialState.ts +1 -22
- package/src/store/chat/slices/message/selectors.test.ts +1 -1
- package/src/store/chat/slices/message/selectors.ts +1 -1
- package/src/store/chat/slices/plugin/action.test.ts +1 -1
- package/src/store/chat/slices/share/action.test.ts +1 -1
- package/src/store/chat/slices/topic/action.test.ts +1 -1
- package/src/store/chat/store.ts +3 -0
- /package/src/store/chat/slices/{message → aiChat}/actions/rag.ts +0 -0
- /package/src/store/chat/{slices/message/utils.ts → utils/messageMapKey.ts} +0 -0
@@ -4,7 +4,7 @@ import { DEFAULT_INBOX_AVATAR, DEFAULT_USER_AVATAR } from '@/const/meta';
|
|
4
4
|
import { INBOX_SESSION_ID } from '@/const/session';
|
5
5
|
import { useAgentStore } from '@/store/agent';
|
6
6
|
import { agentSelectors } from '@/store/agent/selectors';
|
7
|
-
import { messageMapKey } from '@/store/chat/
|
7
|
+
import { messageMapKey } from '@/store/chat/utils/messageMapKey';
|
8
8
|
import { featureFlagsSelectors } from '@/store/serverConfig';
|
9
9
|
import { createServerConfigStore } from '@/store/serverConfig/store';
|
10
10
|
import { useSessionStore } from '@/store/session';
|
@@ -7,8 +7,8 @@ import { PLUGIN_SCHEMA_API_MD5_PREFIX, PLUGIN_SCHEMA_SEPARATOR } from '@/const/p
|
|
7
7
|
import { chatService } from '@/services/chat';
|
8
8
|
import { messageService } from '@/services/message';
|
9
9
|
import { chatSelectors } from '@/store/chat/selectors';
|
10
|
-
import { messageMapKey } from '@/store/chat/slices/message/utils';
|
11
10
|
import { useChatStore } from '@/store/chat/store';
|
11
|
+
import { messageMapKey } from '@/store/chat/utils/messageMapKey';
|
12
12
|
import { useToolStore } from '@/store/tool';
|
13
13
|
import { ChatErrorType } from '@/types/fetch';
|
14
14
|
import { ChatMessage, ChatToolPayload, MessageToolCall } from '@/types/message';
|
@@ -3,7 +3,7 @@ import { act, renderHook } from '@testing-library/react';
|
|
3
3
|
import { DEFAULT_USER_AVATAR_URL } from '@/const/meta';
|
4
4
|
import { shareService } from '@/services/share';
|
5
5
|
import { useChatStore } from '@/store/chat';
|
6
|
-
import { messageMapKey } from '@/store/chat/
|
6
|
+
import { messageMapKey } from '@/store/chat/utils/messageMapKey';
|
7
7
|
import { ChatMessage } from '@/types/message';
|
8
8
|
|
9
9
|
describe('shareSlice actions', () => {
|
@@ -6,7 +6,7 @@ import { LOADING_FLAT } from '@/const/message';
|
|
6
6
|
import { chatService } from '@/services/chat';
|
7
7
|
import { messageService } from '@/services/message';
|
8
8
|
import { topicService } from '@/services/topic';
|
9
|
-
import { messageMapKey } from '@/store/chat/
|
9
|
+
import { messageMapKey } from '@/store/chat/utils/messageMapKey';
|
10
10
|
import { ChatMessage } from '@/types/message';
|
11
11
|
import { ChatTopic } from '@/types/topic';
|
12
12
|
|
package/src/store/chat/store.ts
CHANGED
@@ -13,9 +13,11 @@ import { ChatMessageAction, chatMessage } from './slices/message/action';
|
|
13
13
|
import { ChatPluginAction, chatPlugin } from './slices/plugin/action';
|
14
14
|
import { ShareAction, chatShare } from './slices/share/action';
|
15
15
|
import { ChatTopicAction, chatTopic } from './slices/topic/action';
|
16
|
+
import { chatAiChat, ChatAIChatAction } from './slices/aiChat/action';
|
16
17
|
|
17
18
|
export interface ChatStoreAction
|
18
19
|
extends ChatMessageAction,
|
20
|
+
ChatAIChatAction,
|
19
21
|
ChatTopicAction,
|
20
22
|
ShareAction,
|
21
23
|
ChatEnhanceAction,
|
@@ -31,6 +33,7 @@ const createStore: StateCreator<ChatStore, [['zustand/devtools', never]]> = (...
|
|
31
33
|
...initialState,
|
32
34
|
|
33
35
|
...chatMessage(...params),
|
36
|
+
...chatAiChat(...params),
|
34
37
|
...chatTopic(...params),
|
35
38
|
...chatShare(...params),
|
36
39
|
...chatEnhance(...params),
|
File without changes
|
File without changes
|