Skip to content

Commit b2f064f

Browse files
committed
update
1 parent e1c1260 commit b2f064f

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

src/features/Conversation/components/History/index.tsx

+7-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ import { memo } from 'react';
77
import { useTranslation } from 'react-i18next';
88
import { Center, Flexbox } from 'react-layout-kit';
99

10+
import { agentChatConfigSelectors } from '@/store/agent/selectors';
11+
import { useAgentStore } from '@/store/agent/store';
1012
import { useChatStore } from '@/store/chat';
1113
import { topicSelectors } from '@/store/chat/selectors';
1214

@@ -35,10 +37,14 @@ const History = memo(() => {
3537
return [history?.content, history?.model];
3638
});
3739

40+
const enableCompressHistory = useAgentStore(
41+
agentChatConfigSelectors.currentChatConfig,
42+
).enableCompressHistory;
43+
3844
return (
3945
<Flexbox paddingInline={16} style={{ paddingBottom: 8 }}>
4046
<HistoryDivider enable />
41-
{!!content && (
47+
{enableCompressHistory && !!content && (
4248
<Flexbox className={styles.container} gap={8}>
4349
<Flexbox align={'flex-start'} gap={8} horizontal>
4450
<Center height={20} width={20}>

src/store/chat/slices/aiChat/actions/generateAIChat.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,9 @@ export const generateAIChat: StateCreator<
538538
// to upload image
539539
const uploadTasks: Map<string, Promise<{ id?: string; url?: string }>> = new Map();
540540

541-
const historySummary = topicSelectors.currentActiveTopicSummary(get());
541+
const historySummary = chatConfig.enableCompressHistory
542+
? topicSelectors.currentActiveTopicSummary(get())
543+
: undefined;
542544
await chatService.createAssistantMessageStream({
543545
abortController,
544546
params: {

0 commit comments

Comments
 (0)