@lobehub/chat 0.63.0 → 0.63.2
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/features/AgentSetting/AgentConfig/index.tsx +6 -8
- package/src/features/AgentSetting/AgentMeta/index.tsx +35 -50
- package/src/features/AgentSetting/AgentPlugin/index.tsx +9 -15
- package/src/features/AgentSetting/AgentPrompt/index.tsx +10 -11
- package/src/features/AgentSetting/StoreUpdater.tsx +22 -0
- package/src/features/AgentSetting/index.tsx +25 -0
- package/src/features/AgentSetting/store/action.ts +212 -0
- package/src/features/AgentSetting/store/index.ts +12 -0
- package/src/features/AgentSetting/store/initialState.ts +28 -0
- package/src/features/AgentSetting/store/reducers/config.ts +43 -0
- package/src/features/AgentSetting/store/reducers/meta.ts +21 -0
- package/src/helpers/export.ts +2 -1
- package/src/pages/chat/SessionList/List/Item/Actions.tsx +2 -1
- package/src/pages/chat/SessionList/List/Item/index.tsx +3 -2
- package/src/pages/chat/SessionList/List/index.tsx +2 -1
- package/src/pages/chat/[id]/index.page.tsx +2 -1
- package/src/pages/chat/[id]/setting/index.page.tsx +10 -16
- package/src/pages/chat/features/Conversation/ChatList/MessageExtra.tsx +2 -1
- package/src/pages/chat/features/Conversation/ChatList/index.tsx +2 -6
- package/src/pages/chat/features/Conversation/Input/Action.tsx +2 -1
- package/src/pages/chat/features/Conversation/Input/Token.tsx +2 -1
- package/src/pages/chat/features/Header/Mobile.tsx +2 -1
- package/src/pages/chat/features/Header/PC.tsx +2 -1
- package/src/pages/chat/features/Sidebar/SystemRole.tsx +2 -1
- package/src/pages/chat/features/Sidebar/Topic/index.tsx +2 -1
- package/src/pages/index.page.tsx +2 -1
- package/src/pages/settings/Settings/Agent.tsx +13 -12
- package/src/store/global/slices/agent.ts +6 -57
- package/src/store/session/index.ts +0 -1
- package/src/store/session/initialState.ts +1 -3
- package/src/store/session/slices/agentConfig/action.ts +0 -193
- package/src/store/session/slices/agentConfig/initialState.ts +0 -18
- package/src/store/session/slices/agentConfig/selectors.ts +0 -9
- package/src/store/session/slices/chat/actions/message.ts +6 -6
- package/src/types/session.ts +8 -1
- package/src/features/AgentSetting/index.ts +0 -4
|
@@ -263,8 +263,7 @@ export const chatMessage: StateCreator<
|
|
|
263
263
|
},
|
|
264
264
|
|
|
265
265
|
sendMessage: async (message) => {
|
|
266
|
-
const { dispatchMessage, realFetchAIResponse,
|
|
267
|
-
get();
|
|
266
|
+
const { dispatchMessage, realFetchAIResponse, activeTopicId } = get();
|
|
268
267
|
const session = sessionSelectors.currentSession(get());
|
|
269
268
|
if (!session || !message) return;
|
|
270
269
|
|
|
@@ -281,10 +280,11 @@ export const chatMessage: StateCreator<
|
|
|
281
280
|
|
|
282
281
|
await realFetchAIResponse(messages, userId);
|
|
283
282
|
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
283
|
+
// TODO: AgentSettings 提供一个外部调用的 hooks
|
|
284
|
+
// const chats = chatSelectors.currentChats(get());
|
|
285
|
+
// if (chats.length >= 4) {
|
|
286
|
+
// autocompleteSessionAgentMeta(session.id);
|
|
287
|
+
// }
|
|
288
288
|
},
|
|
289
289
|
|
|
290
290
|
stopGenerateMessage: () => {
|
package/src/types/session.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ChatMessageMap } from './chatMessage';
|
|
2
2
|
import { LLMExample, LLMParams, LanguageModel } from './llm';
|
|
3
|
-
import { BaseDataModel } from './meta';
|
|
3
|
+
import { BaseDataModel, MetaData } from './meta';
|
|
4
4
|
import { ChatTopicMap } from './topic';
|
|
5
5
|
|
|
6
6
|
export enum LobeSessionType {
|
|
@@ -84,6 +84,13 @@ export interface LobeAgentSession extends LobeSessionBase {
|
|
|
84
84
|
type: LobeSessionType.Agent;
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
+
export interface LobeAgentSettings {
|
|
88
|
+
/**
|
|
89
|
+
* 语言模型角色设定
|
|
90
|
+
*/
|
|
91
|
+
config: LobeAgentConfig;
|
|
92
|
+
meta: MetaData;
|
|
93
|
+
}
|
|
87
94
|
export type LobeSessions = Record<string, LobeAgentSession>;
|
|
88
95
|
|
|
89
96
|
export type LobeAgentConfigKeys =
|