File tree 2 files changed +10
-2
lines changed
features/Conversation/components/History
store/chat/slices/aiChat/actions
2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,8 @@ import { memo } from 'react';
7
7
import { useTranslation } from 'react-i18next' ;
8
8
import { Center , Flexbox } from 'react-layout-kit' ;
9
9
10
+ import { agentChatConfigSelectors } from '@/store/agent/selectors' ;
11
+ import { useAgentStore } from '@/store/agent/store' ;
10
12
import { useChatStore } from '@/store/chat' ;
11
13
import { topicSelectors } from '@/store/chat/selectors' ;
12
14
@@ -35,10 +37,14 @@ const History = memo(() => {
35
37
return [ history ?. content , history ?. model ] ;
36
38
} ) ;
37
39
40
+ const enableCompressHistory = useAgentStore (
41
+ agentChatConfigSelectors . currentChatConfig ,
42
+ ) . enableCompressHistory ;
43
+
38
44
return (
39
45
< Flexbox paddingInline = { 16 } style = { { paddingBottom : 8 } } >
40
46
< HistoryDivider enable />
41
- { ! ! content && (
47
+ { enableCompressHistory && ! ! content && (
42
48
< Flexbox className = { styles . container } gap = { 8 } >
43
49
< Flexbox align = { 'flex-start' } gap = { 8 } horizontal >
44
50
< Center height = { 20 } width = { 20 } >
Original file line number Diff line number Diff line change @@ -538,7 +538,9 @@ export const generateAIChat: StateCreator<
538
538
// to upload image
539
539
const uploadTasks : Map < string , Promise < { id ?: string ; url ?: string } > > = new Map ( ) ;
540
540
541
- const historySummary = topicSelectors . currentActiveTopicSummary ( get ( ) ) ;
541
+ const historySummary = chatConfig . enableCompressHistory
542
+ ? topicSelectors . currentActiveTopicSummary ( get ( ) )
543
+ : undefined ;
542
544
await chatService . createAssistantMessageStream ( {
543
545
abortController,
544
546
params : {
You can’t perform that action at this time.
0 commit comments